Skip to content

Run automation

Runs another automation with these inputs and waits for what it returns.

@lainstack/automation/run · Flow

Use this block to call another automation of the same workspace and wait for its typed result. Only an automation whose published version starts with the called trigger (@lainstack/automation/called-trigger) can be called. The two contract snapshots (inputSchemaSnapshot, outputSchemaSnapshot) must match the input and output schemas on that trigger. Copy them from the called automation. Never invent them. A block added from the “Automations” group of the block library is filled in for you.

  • The block leaves on completed or failed. Wire failed. On completed, result is typed by the called automation’s returns. On failed, read error.code: callee_contract_changed, call_depth_exceeded, call_limit_exceeded, call_file_unreadable, return_unresolved, callee_failed, callee_cancelled, timeout, not_found or test_run_requires_sample.
  • Each call runs the live published version of the called automation. If its contract changed in a breaking way, the call fails with callee_contract_changed until the snapshots are updated.
  • Calls are limited: at most 3 levels deep, no automation may call one already in the call chain, and one run may make at most 100 calls.
  • The called run has its own history. It may wait for approvals, so the caller can wait a long time. timeoutMs is empty by default (no limit).
  • Cancelling the calling run cancels the called run.
  • Files: up to 32 attachments go in. Returned files arrive as attachments, copied into this run.
  • A test run does not start the called automation. Pin a sample on this block instead (guide testing), or the block fails with test_run_requires_sample.
Setting Key Type Details
Called automation inputs (required) inputSchemaSnapshot Value
Called automation returns (required) outputSchemaSnapshot Value
Inputs (required) inputs Record The values passed to the called automation.
Attachments attachments Value Files passed to the called automation.
Output Path Type
Returned files attachments Value
Called run ID run.id Text
Error code error.code Text
Error message error.message Text
Exit Port Notes
Completed completed
Failed failed Failure exit.