Skip to main content
View as Markdown

Sub-Workflows

The automation family lets one workflow invoke another. It is how a step shared by five automations becomes one automation the other five call, instead of five copies that drift apart.

Two operators: call invokes a target, return sends a result back.

Calling a Sub-Workflow

automation/call invokes an automation that declares an automation-call trigger.

app.yaml
- name: enrich
  type: automation
  operator: call
  props:
    name: enrich-lead
    inputData: { email: '{{trigger.data.record.email}}' }
    mode: sync
    maxDepth: 10
Prop Description
name Required. Target automation name, kebab-case.
inputData Key-value input handed to the callee. It reads this at {{trigger.input.*}}.
mode sync (wait for the callee, the default) or async (fire and continue).
maxDepth Recursion guard, 1–100. Defaults to 10.

maxDepth stops a chain that calls itself, directly or through intermediaries. The callee can see how deep it currently is at {{trigger.depth}}, and which automation invoked it at {{trigger.caller}}.

Returning a Result

automation/return hands output back to the caller. It is only meaningful in an automation whose trigger is automation-call.

app.yaml
- name: done
  type: automation
  operator: return
  props:
    data:
      score: '{{computeScore.result}}'
      tier: '{{classify.result}}'
Prop Description
data Required. Key-value output returned to the calling automation.

data is the only property, and it is required — a return action without it fails config decode. In the parent, the result arrives as steps.{name}.result.*, so the call above is read back as {{enrich.result.score}}.

Composition vs. Failure Handling

automation/call invokes a target that declares an automation-call trigger, and (in sync mode) waits for its result. To react to a workflow that failed, use the automation-failure trigger instead — it fires after the fact, on a run you did not start, and cannot influence it.

You want Use
Reuse a step across several automations automation/call with mode: sync.
Kick off long work without blocking this run automation/call with mode: async.
Be notified when some other automation breaks An automation-failure trigger.
Recover from a failing step inside this run Per-action retry.

Last updated September 1, 2026

This documentation was written with AI, so errors or outdated content are possible. Sovrium is in beta. Contributions and corrections are welcome.

Built with Sovrium