Skip to Content
Runbase

workflows

The workflows.* tools of the Runbase MCP server, generated from their definitions.

workflows.activate

Activates a workflow (refused if its definition is invalid): its triggers fire.

NameTypeRequiredDescription
idstringyesWorkflow id
workspacestringnoWorkspace id or name (default: active workspace)

workflows.create

Creates a workflow (draft status, version 1). Definition: trigger, steps, next, entry. next[step][branch] = a step id or an array of ids (steps started in parallel). entry = steps started by the trigger (absent: the first step). Event trigger: {"type": "trigger.event", "event": "<event type>"} (eventType accepted). Without a join, two paths that converge run the common step twice; step join: true: waits for all paths and runs only once. Step options (next to input): timeout ("30s", "5m"; default 5m, network calls included) and retry { attempts (1-10, default 3), backoff ("1s", doubled on each attempt), continueOnFail (after the last failure, follows the error branch if connected, otherwise the first) }. timeout at definition level: global run deadline ("2h"). human.approve accepts input.timeout ("2d"): without a decision, expired branch if connected, otherwise failure. concurrencyKey at definition level: template rendered at run start (e.g. "{{record.company_id}}"): at most one active run per key value, later runs wait their turn (creation order), nothing is dropped. condition and switch read the record (object, recordId, condition / field) or, in value mode, any run value: condition { left: "{{steps.x.output.y}}", op, right }, switch { value: "{{steps.x.output.y}}", cases: [{ id, label, op, value }] } (filter operators: eq, neq, gt, in, contains, is_empty…). Input variables: {{record.…}}, {{event.…}} ({{event.recordId}} = record linked to the triggering event), {{steps.<id>.output.…}}, {{now}}, {{today}}, {{run.id}}, {{run.test}} (true in a test run), {{workflow.id}} (an unknown variable is reported by workflows.validate); in loop.do: {{item}}, {{index}} and all run variables (fn.* and raw-input blocks allowed). Triggers: trigger.schedule { cron, object? (without object: a single run), filter?, timezone? (IANA) }; trigger.run_failed { workflow? }: error workflow started when a run fails ({{event.runId}}, {{event.workflowName}}, {{event.error}}). Sub-workflow: block workflow.run { workflow (id or name), recordId?, event?, wait (default true: waits, ok/error branches, output = last output) }, max depth 5. pins { stepId: { output, branch? } }: pinned outputs replayed by dry_run and test_step.

NameTypeRequiredDescription
namestringyes
definitionobjectyes
workspacestringnoWorkspace id or name (default: active workspace)

workflows.deactivate

Pauses a workflow: its triggers no longer fire and its running runs are cancelled at their next step.

NameTypeRequiredDescription
idstringyesWorkflow id
workspacestringnoWorkspace id or name (default: active workspace)

workflows.delete

Deletes a workflow, its versions and its whole run history. Irreversible: confirm: true required (workflows.deactivate is enough to stop it).

NameTypeRequiredDescription
idstringyesWorkflow id
confirmbooleanno
workspacestringnoWorkspace id or name (default: active workspace)

workflows.dry_run

Runs a definition without ever writing anything: writes, sends, external calls, loops and functions with network or 'write' permissions are simulated (first branch, null output); reads are real. AI blocks (ai.*) simulated by default, real and billed only with ai: true. One run per record in records; without records, a single run without a record (useful for a workflow triggered by an event or webhook); event = payload of the triggering event ({{event.…}}). Pinned outputs (definition.pins[stepId] = \{ output, branch? \}) replayed instead of running the step. A join: true step runs once, after the other paths. Returns per run the paths taken (paths, one per parallel execution branch; path: all steps flattened), with for each step input, output, branch and reason.

NameTypeRequiredDescription
definitionobjectyes
recordsarraynoRecord ids (optional)
eventanynoPayload of the triggering event
aibooleannotrue: really runs the AI blocks (paid)
workspacestringnoWorkspace id or name (default: active workspace)

workflows.get

Reads a workflow and the definition of its current version.

NameTypeRequiredDescription
idstringyesWorkflow id
workspacestringnoWorkspace id or name (default: active workspace)

workflows.list

Lists the workspace workflows.

NameTypeRequiredDescription
workspacestringnoWorkspace id or name (default: active workspace)

workflows.restore

Restores a previous version (creates a new version with its definition).

NameTypeRequiredDescription
idstringyesWorkflow id
versionintegeryes
workspacestringnoWorkspace id or name (default: active workspace)

workflows.run_manual

trigger.manual: starts a workflow on a record or a selection of records (no record = one run without a record). Records that already have an active run are skipped.

NameTypeRequiredDescription
idstringyesWorkflow id
recordIdsarrayyes
workspacestringnoWorkspace id or name (default: active workspace)

workflows.test_step

Tests a single step of a definition: input provided (otherwise the definition's, templates rendered), context recordId and/or event, outputs of previous steps via steps { stepId: output } (otherwise pinned outputs definition.pins). Side effects simulated unless live: true (real execution: writes, sends, paid AI). Returns rendered input, branch, output.

NameTypeRequiredDescription
definitionobjectyes
stepIdstringyes
inputobjectno
recordIdstringno
eventanyno
stepsobjectno
livebooleanno
workspacestringnoWorkspace id or name (default: active workspace)

workflows.update

Updates a workflow. A new definition creates a new version.

NameTypeRequiredDescription
idstringyesWorkflow id
namestringno
statusstringnoOne of: draft, active, paused.
definitionobjectno
workspacestringnoWorkspace id or name (default: active workspace)

workflows.validate

Validates a definition: unconnected steps, branches, block inputs, conditions, fn.<name> inputs (required fields of the inputSchema, {{steps.x.output.y}} and {{record.y}} refs to declared fields). Returns { errors, warnings }: errors empty = valid; warnings = non-blocking (refs that cannot be checked before the run, such as {{event.…}}).

NameTypeRequiredDescription
definitionobjectyes
workspacestringnoWorkspace id or name (default: active workspace)

workflows.versions

Lists the (immutable) versions of a workflow.

NameTypeRequiredDescription
idstringyesWorkflow id
workspacestringnoWorkspace id or name (default: active workspace)

On this page