Step Types

Pick the simplest step type that fits: sync HTTP for fast services, async HTTP for long-running work with webhook callbacks, script for in-engine transforms, and flow for reusable sub-flows.

Picking the Right Step Type

A Step should be the simplest type that fits the job:

  • Sync when the work finishes in one request
  • Async when something needs to continue in the background
  • Script when the logic belongs inside the engine
  • Flow when packaging reusable Goals

Sync HTTP Steps

Use sync Steps when you’re calling a service that returns immediately.

{
  "id": "lookup-customer",
  "type": "sync",
  "http": {
    "method": "GET",
    "endpoint": "https://api.example.com/customers/{customer_id}",
    "timeout": 5000,
    "health_check": "https://api.example.com/health"
  }
}

Sync Steps block until the response arrives. They’re appropriate for services with predictable response times. The optional health_check endpoint is polled by the engine to track Step availability and surface health on the catalog.

Async HTTP Steps

Use async Steps when you initiate work that completes later via webhook.

{
  "id": "process-payment",
  "type": "async",
  "http": {
    "method": "POST",
    "endpoint": "https://api.example.com/payments/capture",
    "timeout": 1000
  }
}

The Step calls the endpoint and provides a webhook URL. The service calls back when done. Argyll holds the Flow state until the callback arrives.

Script Steps

Use script Steps for small transforms, routing, and glue logic. Scripts run inside the engine; no external service required.

{
  "id": "calculate-total",
  "type": "script",
  "script": {
    "language": "lua",
    "script": "return {total = price * quantity}"
  }
}

Supported languages: lua (with io, os, and debug modules excluded) and ale (Argyll’s native Lisp-like language, purely functional).

Sub-Flow Steps

Use Sub-Flow Steps to package reusable sets of Goals.

{
  "id": "authorize-user",
  "type": "flow",
  "flow": {
    "goals": ["check-permissions"]
  }
}

The Sub-Flow Goal is check-permissions. If it depends on fetch-user, Argyll will automatically include that Step in the Sub-Flow’s Plan.

Sub-Flow Steps let you compose complex Flows from simpler ones and reuse patterns across Flows.