Open MercatoDocsSearch docsAPI reference

User guide

Step Types

Pick a step according to what the process needs next. Starting a run, performing an activity, waiting for a person and finishing the process use different step types.

Step Types Overview

Step TypePurposeExecutionWhen to Use
STARTEntry pointAuto-advances immediatelyBeginning of every workflow
ENDExit pointCompletes the workflowEnd of every workflow path
USER_TASKHuman decision/inputWaits for user actionApprovals, reviews, manual data entry
AUTOMATEDAutomated processingExecutes activities, then advancesAPI calls, calculations, data updates
WAIT_FOR_SIGNALExternal triggerWaits for signal from outsidePayment confirmations, webhook callbacks
WAIT_FOR_CONDITIONWait on the run's own dataWaits until a condition over the context holds"Wait until the grid approval lands", "wait until the balance is paid"
IF_ELSETwo-way decisionAdvances immediately, routes on conditionsYes/no gates: qualified, approved, in budget
SWITCHMulti-way decisionAdvances immediately, routes on one field's valueRouting on a status, a plan tier, a financing choice
SUB_WORKFLOWCall another workflowExecutes child workflowReusable processes, modular workflows

Tip · Changing your mind

A step's type is not permanent. The step inspector's Change type… control converts a step in place, keeping its id, name, position and wiring; configuration the new type cannot execute is parked in a visible Unmapped configuration drawer rather than deleted, so converting back restores it. START and END are the exceptions – they define the shape of the workflow and cannot be converted.

START

The START step is the entry point for every workflow. When you start a workflow instance, execution begins here.

Characteristics:

Use Cases:

Example:

{
  "stepId": "start",
  "stepName": "Start",
  "stepType": "START"
}

END

The END step marks completion of the workflow. When execution reaches an END step, the workflow instance is marked as COMPLETED.

Characteristics:

Use Cases:

Example:

{
  "stepId": "end-approved",
  "stepName": "Request Approved",
  "stepType": "END"
}

USER_TASK

USER_TASK steps require human intervention – someone needs to review data, make a decision, or provide input.

Characteristics:

Configuration:

Assignment

Assign tasks to specific users or roles:

Form Schema

Define fields users must fill when completing the task:

{
  "userTaskConfig": {
    "formSchema": [
      {
        "fieldName": "decision",
        "fieldType": "select",
        "label": "Decision",
        "required": true,
        "options": ["approve", "reject"]
      },
      {
        "fieldName": "comments",
        "fieldType": "textarea",
        "label": "Comments",
        "required": false
      }
    ]
  }
}

Deadline, reminders and breach

The older escalationRules field is still accepted for existing definitions but nothing executes it – see Deadlines, reminders and breach.

Decisions

Bind a button to each outgoing route so the assignee's choice is what routes the run, instead of a free-text field the next step has to interpret. See Decisions.

Use Cases:

Learn more about user tasks →

AUTOMATED

AUTOMATED steps perform automatic processing without human intervention. They execute activities (like calling APIs or sending emails) and automatically advance when complete.

Characteristics:

Configuration:

Activities can be configured either on the step itself or on outgoing transitions:

{
  "stepId": "process-payment",
  "stepName": "Process Payment",
  "stepType": "AUTOMATED",
  "activities": [
    {
      "activityId": "call-payment-gateway",
      "activityName": "Call Payment Gateway",
      "activityType": "CALL_API",
      "config": {
        "url": "https://payment-gateway.example.com/charge",
        "method": "POST",
        "body": {
          "amount": "{{context.amount}}",
          "currency": "USD"
        }
      }
    }
  ]
}

Use Cases:

Learn more about activities →

WAIT_FOR_SIGNAL

WAIT_FOR_SIGNAL steps pause workflow execution until an external system sends a specific signal. This is useful for long-running processes that depend on events outside the workflow.

Characteristics:

Configuration:

{
  "stepId": "wait-payment",
  "stepName": "Wait for Payment Confirmation",
  "stepType": "WAIT_FOR_SIGNAL",
  "signalConfig": {
    "signalName": "payment-confirmed",
    "timeout": "7 days"
  }
}

Sending Signals:

External systems send signals via API:

POST /api/workflows/instances/{instanceId}/signal
{
  "signalName": "payment-confirmed",
  "payload": {
    "transactionId": "txn_123",
    "paidAmount": 150.00
  }
}

The signal payload is merged into the workflow context, making it available to subsequent steps.

Use Cases:

Learn more about signals →

SUB_WORKFLOW

SUB_WORKFLOW steps call another workflow as a child process. This enables workflow reuse and modular design.

Characteristics:

Configuration:

{
  "stepId": "sub-validate-customer",
  "stepName": "Validate Customer",
  "stepType": "SUB_WORKFLOW",
  "config": {
    "workflowId": "customer-validation-v1",
    "inputMapping": {
      "customerId": "{{context.customerId}}",
      "orderAmount": "{{context.totalAmount}}"
    },
    "timeout": "1 hour"
  }
}

Output Handling:

When the child workflow completes, its final context is merged into the parent workflow's context under a namespaced key.

Use Cases:

WAIT_FOR_CONDITION

Pause the workflow until something becomes true about the run's own data – no external signal needed. Use it when the thing you are waiting for arrives as a context update rather than as a named event.

{
  "stepId": "await_grid_approval",
  "stepName": "Await grid approval",
  "stepType": "WAIT_FOR_CONDITION",
  "config": {
    "condition": {
      "operator": "AND",
      "rules": [
        { "field": "gridApproval.status", "operator": "==", "value": "APPROVED" }
      ]
    },
    "timeout": "P30D",
    "onTimeout": "FAIL",
    "pollIntervalMs": 3600000
  }
}

Parameters:

The condition is re-checked whenever the instance's context is written, so in practice the workflow wakes as soon as the data lands; the poll is only a safety net for updates that arrive some other way.

IF_ELSE and SWITCH

These two are decision steps. They do no work of their own – they advance immediately, and the decision is made by their outgoing routes, evaluated in priority order. That means everything you already know about transitions applies: each route carries a condition, the routes are ordered, and the last one should be an unconditioned otherwise route.

{
  "steps": [
    { "stepId": "qualify_gate", "stepName": "Qualified?", "stepType": "IF_ELSE" }
  ],
  "transitions": [
    {
      "transitionId": "qualified",
      "fromStepId": "qualify_gate",
      "toStepId": "contact_attempted",
      "trigger": "auto",
      "priority": 100,
      "transitionName": "Qualified",
      "condition": { "operator": "AND", "rules": [{ "field": "leadScore", "operator": ">", "value": 60 }] }
    },
    {
      "transitionId": "not_qualified",
      "fromStepId": "qualify_gate",
      "toStepId": "nurture_lead",
      "trigger": "auto",
      "priority": 0,
      "transitionName": "Otherwise"
    }
  ]
}

In the Studio these steps get a dedicated inspector: you edit the branches as a list of cases with their conditions, drag them to change which is tried first, and the editor warns you when a decision step has no otherwise route – that is the shape that silently stalls a run when nothing matches.

Note · Older engines refuse these definitions

IF_ELSE, SWITCH and WAIT_FOR_CONDITION were added after the first release. A definition that uses them is stamped with the engine version it needs, and an older engine refuses to start it rather than mis-executing a step type it does not understand.

Choosing the Right Step Type

Decision tree for picking a workflow step
Choose the step according to who does the work and whether it waits for an event, user or another workflow.
Diagram source
graph TD
    A[Need a workflow step?] --> B{Human involved?}
    B -->|Yes| C[USER_TASK]
    B -->|No| D{Waiting for external event?}
    D -->|Yes| E[WAIT_FOR_SIGNAL]
    D -->|No| F{Calling another workflow?}
    F -->|Yes| G[SUB_WORKFLOW]
    F -->|No| H{Automated action?}
    H -->|Yes| I[AUTOMATED]
    H -->|No| J{Start or end?}
    J -->|Start| K[START]
    J -->|End| L[END]

    classDef focus fill:#e0f29c,stroke:#34402d,color:#172011,stroke-width:2px
    class C focus

Quick Decision Guide:

  1. Starting a workflow? → Use START
  2. Ending a workflow? → Use END
  3. Need human input or decision? → Use USER_TASK
  4. Waiting for external system? → Use WAIT_FOR_SIGNAL
  5. Calling another workflow? → Use SUB_WORKFLOW
  6. Automated processing? → Use AUTOMATED

Next Steps

See Also:

Previous: Signals · Next: Transitions