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

# Workflows

> Automate business processes across your systems with AI-built workflows triggered by webhooks, schedules, Slack messages, emails, and more

export const Alert = ({type, title, children}) => {
  const getIcon = () => {
    switch (type) {
      case 'info':
        return "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0zm0 15c-.552 0-1-.448-1-1s.448-1 1-1 1 .448 1 1-.448 1-1 1zm1-3H9V6h2v6z' fill='%230099FF'/%3E%3C/svg%3E";
      case 'success':
        return "data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0zm4.293 6.293L9 11.586 5.707 8.293c-.391-.391-1.024-.391-1.414 0s-.391 1.024 0 1.414l4 4c.391.391 1.024.391 1.414 0l6-6c.391-.391.391-1.024 0-1.414s-1.024-.391-1.414 0z' fill='%230CC26D'/%3E%3C/svg%3E";
      case 'warning':
        return "data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbDpzcGFjZT0ncHJlc2VydmUnIHdpZHRoPScxMDgwJyBoZWlnaHQ9JzEwODAnPjxyZWN0IHdpZHRoPScxMDAlJyBoZWlnaHQ9JzEwMCUnIGZpbGw9J3RyYW5zcGFyZW50Jy8+PHBhdGggZD0nTTEzLjc5NCAxMC43NSA4LjMgMS4yNWExLjUgMS41IDAgMCAwLTIuNiAwbC01LjQ5NCA5LjVBMS40OTQgMS40OTQgMCAwIDAgMS41IDEzaDExYTEuNDkzIDEuNDkzIDAgMCAwIDEuMjk0LTIuMjVNNi41IDUuNWEuNS41IDAgMCAxIDEgMFY4YS41LjUgMCAwIDEtMSAwek03IDExYS43NS43NSAwIDEgMSAwLTEuNS43NS43NSAwIDAgMSAwIDEuNScgc3R5bGU9J3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1kYXNoYXJyYXk6bm9uZTtzdHJva2UtbGluZWNhcDpidXR0O3N0cm9rZS1kYXNob2Zmc2V0OjA7c3Ryb2tlLWxpbmVqb2luOm1pdGVyO3N0cm9rZS1taXRlcmxpbWl0OjQ7ZmlsbDojZmY5ZjM1O2ZpbGwtcnVsZTpub256ZXJvO29wYWNpdHk6MScgdHJhbnNmb3JtPSd0cmFuc2xhdGUoLjAyIDE5LjMwNSlzY2FsZSg3Ny4xNCknLz48L3N2Zz4=";
      case 'danger':
        return "data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0zm5.707 4.293L10 9.586 4.293 4.293c-.391-.391-1.024-.391-1.414 0s-.391 1.024 0 1.414L8.586 11l-5.707 5.293c-.391.391-.391 1.024 0 1.414s1.024.391 1.414 0L10 12.414l5.707 5.293c.391.391 1.024.391 1.414 0s.391-1.024 0-1.414L11.414 11l5.707-5.293c.391-.391.391-1.024 0-1.414s-1.024-.391-1.414 0z' fill='%23F45252'/%3E%3C/svg%3E";
      case 'note':
        return "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0zm0 15c-.552 0-1-.448-1-1s.448-1 1-1 1 .448 1 1-.448 1-1 1zm1-3H9V6h2v6z' fill='%230099FF'/%3E%3C/svg%3E";
      default:
        return "";
    }
  };
  return <div className={`alert alert--${type}`}>
      <div className="alert-icon" style={{
    backgroundImage: `url("${getIcon()}")`,
    backgroundRepeat: 'no-repeat',
    backgroundPosition: 'center center',
    backgroundSize: '20px',
    width: '24px',
    height: '24px',
    position: 'absolute',
    left: '16px',
    top: '16px'
  }} />
      <div className="alert-content">
        {title && <div className="alert-title">{title}</div>}
        <div className="alert-body">{children}</div>
      </div>
    </div>;
};

<Alert type="note">
  <p>
    <strong>Coming Soon</strong> - Workflows are coming to Superblocks soon. <a href="mailto:support@superblockshq.com">Contact us</a> to join the early access list.
  </p>
</Alert>

## Overview

Workflows let you automate business processes that span multiple systems (databases, APIs, SaaS tools, and custom logic), triggered automatically on a schedule or from custom events in your systems via wehbooks.

Describe what you want to automate in natural language, and Clark builds your workflow end-to-end on top of your integrations. Superblocks Workflows are real TypeScript code (just like the backend APIs you already use in your applications) but triggered automatically by external events.

## What you can build

* **Webhook automations** - Receive events from Stripe, GitHub, Segment, or any service and react with multi-step logic across your stack
* **Scheduled jobs** - Run reports, sync data, or clean up resources on a cron schedule
* **Slack-triggered workflows** - Let teams kick off approvals, lookups, or actions directly from Slack
* **Email-triggered workflows** - Parse incoming emails to create tickets, route requests, or update records
* **Cross-system orchestration** - Chain together database queries, API calls, AI models, and notifications into reliable automated pipelines

## How it works

### 1. Build with Clark

Tell Clark what you want to automate, just like building a backend API today. Clark writes the workflow logic, wires up your integrations, and handles error cases.

```
"When a new order comes in via webhook from Shopify, enrich the customer
from our Postgres database, run a fraud check against our ML model, and
if approved, update the order status and send a confirmation via Slack."
```

Clark generates a complete TypeScript workflow using your connected integrations. You can inspect the code, test individual steps, and iterate, all from the same editor you use to build apps.

### 2. Add triggers

Every workflow has one or more triggers. Choose from:

| Trigger      | Description                                                                     |
| ------------ | ------------------------------------------------------------------------------- |
| **Webhook**  | HTTP endpoint that receives POST requests from any external service             |
| **Schedule** | Cron-based execution (every 5 minutes, daily at 9am, first Monday of the month) |
| **Slack**    | Activated by a message, slash command, or interaction in Slack                  |
| **Email**    | Activated by an incoming email to a generated address                           |

### 3. Deploy and monitor

Deploy your workflow with one click. Superblocks handles execution reliability, retries, and observability. Every run is logged with full trace visibility (inputs, outputs, timing, and errors for each step) so you can debug production issues in seconds.

## Key capabilities

### Full integration access

Workflows use the same integrations you've already configured in Superblocks: Postgres, Snowflake, REST APIs, Salesforce, and more. No separate configuration or credentials to manage.

### Secure by default

Workflows execute on your On-Premise Agent, so sensitive data never leaves your network. All triggers are authenticated and audited. RBAC controls who can create, edit, and deploy workflows.

### Version controlled

Like all Superblocks resources, workflows have native version control, automatic checkpointing, policy agent enforcement, and one-click deploy. They can also be synced to your Git provider for code review and audit.

## Use cases

| Use case                 | Trigger                 | What it does                                                                        |
| ------------------------ | ----------------------- | ----------------------------------------------------------------------------------- |
| New user onboarding      | Webhook (Auth0)         | Create CRM record, provision accounts, notify team in Slack                         |
| Daily revenue report     | Schedule (9am daily)    | Query Snowflake, format summary, post to #finance Slack channel                     |
| Support escalation       | Email                   | Parse email, create Jira ticket, assign based on priority, notify on-call           |
| Deployment notifications | Webhook (GitHub)        | Track deploys, update status page, post changelog to Slack                          |
| Approval flows           | Slack (slash command)   | Collect approval from managers via Slack buttons, update database, notify requester |
| Data sync                | Schedule (every 15 min) | Sync records between Salesforce and Postgres, log discrepancies                     |
