Skip to content

Use Cases

Three common patterns that show what Orch8.io replaces.

Cold outreach sequence

Send an initial message, wait 2 business days, check if the contact replied, and branch accordingly. If they didn't reply, send a follow-up. If they did, route to a conversion step.

{
  "blocks": [
    {
      "type": "step", "id": "send_initial",
      "handler": "http_request",
      "params": { "url": "https://httpbin.org/post", "method": "POST",
                  "body": { "to": "{{context.data.email}}", "stage": "initial" } },
      "rate_limit_key": "mailbox:outreach@acme.com",
      "retry": { "max_attempts": 3, "initial_backoff": "1s" }
    },
    {
      "type": "step", "id": "wait_and_check",
      "handler": "http_request",
      "delay": { "duration": "2d", "business_days_only": true, "jitter": "2h" },
      "params": { "url": "https://httpbin.org/get?check=replied", "method": "GET" }
    },
    {
      "type": "router", "id": "branch_on_reply",
      "routes": [
        {
          "condition": "context.data.replied == true",
          "block": { "type": "step", "id": "convert", "handler": "log",
                     "params": { "message": "Contact {{context.data.email}} converted", "level": "info" } }
        }
      ],
      "default": {
        "type": "step", "id": "send_followup",
        "handler": "http_request",
        "delay": { "duration": "3d", "business_days_only": true },
        "params": { "url": "https://httpbin.org/post", "method": "POST",
                    "body": { "to": "{{context.data.email}}", "stage": "followup" } },
        "rate_limit_key": "mailbox:outreach@acme.com"
      }
    }
  ]
}

The engine handles rate limits per mailbox (defer, never drop), business day scheduling, jitter to spread sends naturally, and crash recovery if the server restarts mid-sequence.

Multi-channel notification cascade

Send a welcome message. If the user doesn't engage within 4 hours, escalate to email. If still no engagement after 24 hours, send a final reminder. If the user engages at any point, the race completes and cancels the remaining notifications.

{
  "blocks": [
    {
      "type": "race", "id": "notify_until_engaged",
      "semantics": "FirstToSucceed",
      "branches": [
        {
          "type": "step", "id": "wait_for_engagement",
          "handler": "http_request",
          "params": { "url": "https://httpbin.org/get?engaged=1", "method": "GET" },
          "timeout": "48h"
        },
        {
          "type": "parallel", "id": "escalation_cascade",
          "branches": [
            {
              "type": "step", "id": "send_welcome",
              "handler": "http_request",
              "params": { "url": "https://httpbin.org/post", "method": "POST",
                          "body": { "channel": "push", "user": "{{context.data.user_id}}" } }
            },
            {
              "type": "step", "id": "send_email",
              "handler": "http_request",
              "delay": { "duration": "4h" },
              "params": { "url": "https://httpbin.org/post", "method": "POST",
                          "body": { "channel": "email", "user": "{{context.data.user_id}}" } }
            },
            {
              "type": "step", "id": "send_reminder",
              "handler": "http_request",
              "delay": { "duration": "24h" },
              "params": { "url": "https://httpbin.org/post", "method": "POST",
                          "body": { "channel": "reminder", "user": "{{context.data.user_id}}" } }
            }
          ]
        }
      ]
    },
    {
      "type": "step", "id": "log_outcome",
      "handler": "log",
      "params": { "message": "Notification cascade complete", "level": "info" }
    }
  ]
}

The race block runs two branches: one waits for user engagement (via signal or polling), the other sends push immediately, then email after 4 hours, then SMS after 24 hours. If the user engages at any point, the race completes and cancels remaining notifications.

Payment retry sequence

When a payment fails, retry up to 4 times with 3-day delays between attempts. Log a reminder alongside each charge attempt. After the loop, check whether the payment succeeded — if not, downgrade the account.

{
  "blocks": [
    {
      "type": "loop", "id": "retry_payment",
      "condition": "context.data.payment_succeeded != true",
      "max_iterations": 4,
      "body": {
        "type": "parallel", "id": "attempt_and_notify",
        "branches": [
          {
            "type": "step", "id": "charge",
            "handler": "http_request",
            "delay": { "duration": "3d" },
            "params": { "url": "https://httpbin.org/post", "method": "POST",
                        "body": { "action": "charge", "customer": "{{context.data.customer_id}}" } },
            "retry": { "max_attempts": 2, "initial_backoff": "5s" }
          },
          {
            "type": "step", "id": "remind",
            "handler": "log",
            "params": { "message": "Payment retry {{context.data._iteration}} for {{context.data.customer_id}}", "level": "warn" }
          }
        ]
      }
    },
    {
      "type": "router", "id": "check_result",
      "routes": [
        {
          "condition": "context.data.payment_succeeded == true",
          "block": {
            "type": "step", "id": "confirm",
            "handler": "log",
            "params": { "message": "Payment recovered", "level": "info" }
          }
        }
      ],
      "default": {
        "type": "step", "id": "downgrade",
        "handler": "http_request",
        "params": { "url": "https://httpbin.org/post", "method": "POST",
                    "body": { "action": "downgrade", "customer": "{{context.data.customer_id}}" } }
      }
    }
  ]
}

The loop retries the payment up to 4 times with 3-day delays. Parallel sends the reminder alongside each charge attempt. After the loop exits, the router checks whether payment succeeded — if not, the default branch downgrades the account.

More patterns

The three examples above cover the most common cases. For 22 annotated patterns — payment failover, AI agents, email warmup, batch processing, human-input approvals, live workflow migration, and more — see the Orch8 Playbook. Each pattern includes the full JSON sequence definition, step-by-step breakdown, and key takeaways.