> ## Documentation Index
> Fetch the complete documentation index at: https://docs.suprsend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# suprsend-workflow-schema

> Generate valid SuprSend workflow JSON from plain English. This skill teaches your AI agent every workflow node, field, and validation rule.

**Use this skill when** you want your AI agent to generate, edit, or refactor SuprSend workflow JSON - without making up `node_type` values or missing required fields.

The skill loads the full `https://schema.suprsend.com/workflow/v1/schema.json` spec into your agent's context whenever it detects a workflow task. Every generated file lands in `suprsend/workflow/` and is ready to push with the [`suprsend-cli`](/reference/agent-skill-cli) skill.

<CardGroup cols={2}>
  <Card title="Install" icon="download">
    ```bash theme={"system"}
    npx skills add https://github.com/suprsend/skills --skill suprsend-workflow-schema
    ```
  </Card>

  <Card title="Schema spec" icon="file-code" href="https://schema.suprsend.com/workflow/v1/schema.json">
    The JSON Schema the skill validates against.
  </Card>
</CardGroup>

***

## Try it

<Steps>
  <Step title="Paste this into your agent">
    ```text theme={"system"}
    Create a SuprSend workflow JSON with slug "payment-failed".
    Send an email immediately, wait 24 hours, then send an SMS
    only if the user hasn't retried payment yet.
    ```
  </Step>

  <Step title="Your agent generates the file">
    The skill activates and produces `suprsend/workflow/payment-failed.json`:

    ```json theme={"system"}
    {
      "$schema": "https://schema.suprsend.com/workflow/v1/schema.json",
      "slug": "payment-failed",
      "name": "Payment Failed",
      "nodes": [
        { "node_type": "send_email", "...": "..." },
        { "node_type": "branch_waituntil", "duration": "24h", "...": "..." },
        { "node_type": "send_sms", "...": "..." }
      ]
    }
    ```
  </Step>

  <Step title="Push it live">
    ```bash theme={"system"}
    suprsend workflow push --slug payment-failed --commit=true
    ```
  </Step>
</Steps>

<Tip>
  Want more example prompts? See the [Prompt Cheatsheet](/reference/mcp-prompts).
</Tip>

***

## What you can build

<AccordionGroup>
  <Accordion title="Cart abandonment" icon="cart-shopping">
    Wait 1 hour, then email and in-app notification.
  </Accordion>

  <Accordion title="Password reset" icon="key">
    Immediate email with retry SMS after 5 minutes.
  </Accordion>

  <Accordion title="Onboarding drip" icon="route">
    Email today, in-app tomorrow, SMS in 3 days unless the user activates.
  </Accordion>

  <Accordion title="Payment reminder" icon="credit-card">
    Branch on invoice status, escalate channels over a week.
  </Accordion>

  <Accordion title="Re-engagement" icon="user-clock">
    Triggered when a user enters a "dormant" list.
  </Accordion>
</AccordionGroup>

***

## File layout

Every workflow JSON file lives under `suprsend/workflow/`. The filename doesn't matter - but the `slug` field inside does, since that's what the CLI uses to target the workflow.

```
suprsend/
└── workflow/
    ├── cart-abandonment.json
    ├── payment-failed.json
    └── onboarding.json
```

Every file must include a `slug`:

```json theme={"system"}
{
  "$schema": "https://schema.suprsend.com/workflow/v1/schema.json",
  "slug": "cart-abandonment",
  "name": "Cart Abandonment Reminder"
}
```

<Warning>
  Without `slug`, you can't target the workflow with `suprsend workflow push --slug`. The skill always includes it - but double-check after edits.
</Warning>

***

## Node reference

The skill knows every node below. You'll rarely need to look these up by hand, but they're useful for verifying generated output.

<AccordionGroup>
  <Accordion title="Delivery nodes" icon="paper-plane">
    | Node                  | `node_type`                  | Docs                                                                      |
    | --------------------- | ---------------------------- | ------------------------------------------------------------------------- |
    | Email                 | `send_email`                 | [Email](https://docs.suprsend.com/docs/delivery-single-channel.md)        |
    | SMS                   | `send_sms`                   | [SMS](https://docs.suprsend.com/docs/delivery-single-channel.md)          |
    | WhatsApp              | `send_whatsapp`              | [WhatsApp](https://docs.suprsend.com/docs/delivery-single-channel.md)     |
    | In-App Inbox          | `send_inbox`                 | [In-App Inbox](https://docs.suprsend.com/docs/delivery-single-channel.md) |
    | Mobile Push           | `send_mobile_push`           | [Mobile Push](https://docs.suprsend.com/docs/delivery-single-channel.md)  |
    | Web Push              | `send_webpush`               | [Web Push](https://docs.suprsend.com/docs/delivery-single-channel.md)     |
    | Slack                 | `send_slack`                 | [Slack](https://docs.suprsend.com/docs/delivery-single-channel.md)        |
    | MS Teams              | `send_ms_teams`              | [MS Teams](https://docs.suprsend.com/docs/delivery-single-channel.md)     |
    | Multi-Channel         | `send_multi_channel`         | [Multi-Channel](https://docs.suprsend.com/docs/delivery-multi-channel.md) |
    | Smart Channel Routing | `send_smart_channel_routing` | [Smart Channel Routing](https://docs.suprsend.com/docs/smart-delivery.md) |
    | Webhook               | `httpapi_webhook`            | [HTTP API](https://docs.suprsend.com/docs/webhook.md)                     |
  </Accordion>

  <Accordion title="Function nodes" icon="hourglass">
    | Node        | `node_type`  | Docs                                                         |
    | ----------- | ------------ | ------------------------------------------------------------ |
    | Delay       | `delay`      | [Delay](https://docs.suprsend.com/docs/delay.md)             |
    | Batch       | `batch`      | [Batch](https://docs.suprsend.com/docs/batch.md)             |
    | Digest      | `digest`     | [Digest](https://docs.suprsend.com/docs/digest.md)           |
    | Time Window | `timewindow` | [Time Window](https://docs.suprsend.com/docs/time-window.md) |
  </Accordion>

  <Accordion title="Branch nodes" icon="code-branch">
    | Node       | `node_type`        | Docs                                                       |
    | ---------- | ------------------ | ---------------------------------------------------------- |
    | Branch     | `branch`           | [Branch](https://docs.suprsend.com/docs/branch.md)         |
    | Wait Until | `branch_waituntil` | [Wait Until](https://docs.suprsend.com/docs/wait-until.md) |
  </Accordion>

  <Accordion title="Data nodes" icon="database">
    | Node                | `node_type`      | Docs                                                                         |
    | ------------------- | ---------------- | ---------------------------------------------------------------------------- |
    | Fetch               | `httpapi_fetch`  | [Fetch](https://docs.suprsend.com/docs/fetch.md)                             |
    | Transform           | `transform`      | [Data Transform](https://docs.suprsend.com/docs/data-transform.md)           |
    | Invoke Workflow     | `invokeworkflow` | [Invoke Workflow](https://docs.suprsend.com/docs/invoke-workflow.md)         |
    | Update User Profile | `userupdate`     | [Update User Profile](https://docs.suprsend.com/docs/update-user-profile.md) |
  </Accordion>

  <Accordion title="List and Object nodes" icon="layer-group">
    | Node                    | `node_type`                          | Docs                                                                                 |
    | ----------------------- | ------------------------------------ | ------------------------------------------------------------------------------------ |
    | Add User to List        | `subscriberlistoperation_adduser`    | [Add User to List](https://docs.suprsend.com/docs/add-user-to-list.md)               |
    | Remove User from List   | `subscriberlistoperation_removeuser` | [Remove User from List](https://docs.suprsend.com/docs/remove-user-from-list.md)     |
    | Subscribe to Object     | `objectoperation_addsubscription`    | [Subscribe to Object](https://docs.suprsend.com/docs/subscribe-to-object.md)         |
    | Unsubscribe from Object | `objectoperation_removesubscription` | [Unsubscribe from Object](https://docs.suprsend.com/docs/unsubscribe-from-object.md) |
  </Accordion>
</AccordionGroup>

***

## Known limitation

<Warning>
  Agents sometimes produce incorrect `expression_v1` conditions inside `branch_waituntil` nodes. Always review branch logic before pushing to production. See [Wait Until](https://docs.suprsend.com/docs/wait-until.md) for correct syntax.
</Warning>

***

## Learn more

<CardGroup cols={2}>
  <Card title="Schema Guide" icon="book" href="https://github.com/suprsend/skills/blob/HEAD/skills/suprsend-workflow-schema/references/workflow-schema-guide.md">
    Detailed field-by-field schema reference on GitHub.
  </Card>

  <Card title="Design Workflow" icon="diagram-project" href="https://docs.suprsend.com/docs/design-workflow.md">
    How workflows work end-to-end in SuprSend.
  </Card>

  <Card title="suprsend-template-schema skill" icon="file-lines" href="/reference/agent-skill-template-schema">
    Generate the template variants that workflow delivery nodes reference.
  </Card>

  <Card title="suprsend-cli skill" icon="terminal" href="/reference/agent-skill-cli">
    Push generated workflows to your workspace.
  </Card>
</CardGroup>
