Automations

Validate a draft

Changed on

Every finding of the draft, or of a definition checked in its place against this automation’s bindings and config (it is not saved), with its rule code, severity, node and path in plain words. blocking findings stop a publish. Changes nothing.

post/v1/automations/{automationId}/validate

Request

  • Base URL
    https://api.banksync.io
  • Auth
    • API key in header X-API-Key
    • or HTTP bearer

Path parameters

automationId, string required

Automation ID

Headers

Idempotency-Key, string

Makes a retry safe: the same key with the same request replays the first answer for 24 hours instead of running twice, and the same key with a different request is a 409 IDEMPOTENCY_KEY_REUSED. Refusals a retry can outlive — 408, 409, 423, 425, 429 and every 5xx — are never replayed, so retrying with the same key after the cause clears runs the request.

Request body

object required
definition, object

A definition to check in place of the saved draft; it is not saved. Leave it out to validate the draft. A flagbase.automation/1 definition. nodes is keyed by node id (letters, digits, _, -); edges wire { node, port } to { node, port } (port main; a filter also has rejected, a step routing errors error). Each node: ref (the name expressions use), parent: null (or { node, scope } inside a container, e.g. a loop’s body), type { package, operation, version } exactly as the node search answers it, and params as describing the node type answers them. A param is a literal, an expression { "$expr": { "lang": "flagbase", "src": "item.amount > 100" } }, or a binding { "$bind": "<name>" } naming an entry of bindings ({ "kind": "resource", "type": "<the param’s x-resource, e.g. tables.table>" }) that you then point at an id with the set-binding operation. A param with an x-resource (a table, a bank, a feed) takes a binding only, never an id written in. Items: a step runs once per item it is handed and reads it as item. A hand start hands one item (its inputs); a step that answers one value (a list of records) hands one item holding it. Expressions: paths item.amount, item.rows[0]; node('<ref>').out.main (an earlier step’s output); inputs, config.<name>, trigger, run.id, automation.id, state.automation.<key>. Operators = != > >= < <= and or not + - * / % ? : (+ adds numbers: join text with concat(a, b) or a template `Paid ${item.amount}`). Lists: item.rows.filter(current.amount > 100), .map({ date: current.date }), .count(), sum(list), first(list), some(list, current.x). Also if(c, a, b), coalesce(a, b), today(), dateSubtract(today(), 7, 'days'), formatDate(d, 'YYYY-MM-DD'). A table write’s rows may be one expression answering a list of { fieldKey: value }.

Response

The findings

object required
success, true required
data, object required

Changes

    • warning

      changed the pattern of the request property definition/nodes/additionalProperties/icon from ^(?:[a-z]+:[A-Za-z0-9_-]{1,64})?$/u to ^(?:(?=[a-z0-9-]{1,64}$)[a-z]+(?:-[a-z0-9]+)*|[a-z]+:[A-Za-z0-9_-]{1,64})?$/u