Send a steps array and a context object to the Workflow API. Steps run in order and add named outputs to context. The API returns those outputs, or the custom response from a Respond step.
{ "steps": [ // Array of workflow steps to execute ], "context": { // Initial data/variables for the workflow },}
Execution options
The optional options object accepts:
Field
Type
Default
Effect
timeout
Number, 1 to 30000 milliseconds
30000
Limits how long the endpoint waits for a response. It does not cancel operations already running.
validateOnly
Boolean
Execution runs when omitted
Skips execution and returns no step outputs.
validateOnly: true skips execution. The current endpoint invokes validation but does not reject its returned validation errors, so a successful validate-only response does not establish that every step is valid.
Basic example
Simple API call + email
Replace the example API URL with your endpoint and use a Mailjet sender configured for your deployment. The Request step stores the response under user_data; the Email step reads the recipient and name from its data field.
Without a Respond step, the endpoint returns named top-level outputs and execution metadata. duration is in milliseconds; stepsExecuted counts top-level steps.
A Respond step returns its configured body directly, without the success envelope shown above. Generic step failures return HTTP 500 with EXECUTION_ERROR; request validation and template failures return HTTP 400 with VALIDATION_ERROR or TEMPLATE_ERROR. A failed Request step stops execution, so a later Rule or Respond cannot handle that failure unless a Batch captures it as data.
Common patterns
1. Data enrichment
Fetch a user's profile and orders, then return both response bodies:
The context object supplies the workflow's initial data. Steps can access it with Morpher templates:
A field consisting only of {{ variableName }} preserves the value's type.
Text surrounding a template, such as Hello {{ name }}!, produces a string.
Supply timestamps, request IDs, and calculated values in context when needed. They are not injected automatically. See Context management for nested step scope and result paths.
Step outputs
Each step with an output name adds its result to the context of its sequence. A later step with the same name replaces that value:
Code
{ "type": "request", "output": "user_data", // Results available as {{ user_data.data }} "config": { ... }}
Template syntax
String interpolation: {{ user.name }}
Typed values: {{ user.age }} as the entire field
Nested access: {{ user.profile.address.city }}
Helpers: {{ user.name | capitalize }}
Branching: Use a Rule step for comparisons; Morpher accepts paths and helper pipelines, not JavaScript expressions.
Best practices
1. Use descriptive output names
Use names that identify the data, such as customer_profile. The snippets below show only the output field.
Group related configuration and input data. The API key below is a placeholder; supply real credentials at execution time and avoid returning them in responses.
Request errors stop execution, so a later Rule cannot catch a failed HTTP call. This example branches on an available successful result. To collect failures as data, use Batch with failFast: false and inspect the child's error field.
This Rule is an incomplete step outline. Replace the success branch's {...} with your response body before execution.