These docs cover the S6S workflow engine — the developer playground layer underneath the product. For the main AI Visibility product (brand monitoring, the unified Report, fix actions), start at /docs/ai-visibility.

Connecting Workflows

Four ways to connect S6S workflows to your website, app, or service.

Webhooks

The simplest way to connect a workflow to a website. Deploy a workflow with a webhook trigger, get a unique URL, and POST data to it from your frontend or backend.

1. Deploy with a webhook trigger

cURL
curl -X POST https://s6s.ai/api/v1/workflows/deploy \
  -H "Authorization: Bearer s6s_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Contact Form Handler",
    "trigger": {
      "type": "webhook",
      "path": "/contact-form",
      "method": "POST"
    },
    "steps": [
      {
        "ref": "classify",
        "action": "ai",
        "config": {
          "model": "gpt-4o-mini",
          "systemPrompt": "Classify as: sales, support, or spam.",
          "userPrompt": "From: {{trigger.output.body.name}}\nMessage: {{trigger.output.body.message}}"
        }
      },
      {
        "ref": "notify",
        "action": "slack.send_message",
        "config": {
          "channel": "#leads",
          "text": "New {{classify.output.response}}: {{trigger.output.body.message}}"
        },
        "credential": "slack"
      }
    ],
    "flow": ["classify", "notify"]
  }'

2. Get your webhook URL

The deploy response includes your unique URL and a secret for authentication:

{
  "ok": true,
  "workflowId": "abc-123",
  "webhookTrigger": {
    "invokeUrl": "https://s6s.ai/api/webhooks/contact-form",
    "secret": "whsec_a1b2c3..."
  }
}

3. Call it from your website

JavaScript (frontend or backend)
const response = await fetch(
  "https://s6s.ai/api/webhooks/contact-form",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-Webhook-Token": "whsec_a1b2c3..."
    },
    body: JSON.stringify({
      name: form.name,
      email: form.email,
      message: form.message
    })
  }
);

Webhook authentication

Four methods supported (use any one):

MethodHeaderDescription
Direct tokenX-Webhook-TokenSimple comparison (constant-time)
HMAC signatureX-Webhook-SignatureHMAC-SHA256 of request body (hex)
BearerAuthorization: BearerStandard Bearer token auth
TelegramX-Telegram-Bot-Api-Secret-TokenTelegram bot webhook verification

Data available to steps

{{trigger.output.body}}          // Parsed JSON body
{{trigger.output.body.name}}     // Specific field
{{trigger.output.headers}}       // Request headers
{{trigger.output.query}}         // Query string parameters
{{trigger.output.method}}        // HTTP method
{{trigger.output.receivedAt}}    // ISO timestamp

REST API

For backends and scripts. Deploy a workflow, trigger it programmatically, and get results back via polling, streaming, or callbacks.

Run an existing workflow

curl -X POST https://s6s.ai/api/v1/workflows/{workflowId}/run \
  -H "Authorization: Bearer s6s_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "input": { "company": "Acme Corp" } }'

Getting results back

MethodHow it works
PollingGET /api/runs/{runId} — check status and step outputs
StreamingGET /api/runs/{runId}/stream — Server-Sent Events with real-time step progress
CallbackPass callback_url on deploy — S6S POSTs results when done (3 retries)
WaitPass waitForCompletion: true on deploy — blocks up to 30s

See the full API reference for all endpoints, parameters, and response formats.

Scheduled (Cron)

For recurring jobs like daily reports, periodic monitors, or data syncs. No external trigger needed — S6S runs the workflow on your schedule.

Recipe JSON
{
  "name": "Daily Competitor Report",
  "trigger": {
    "type": "schedule",
    "cron": "0 9 * * 1-5",
    "timezone": "America/New_York"
  },
  "steps": [
    {
      "ref": "research",
      "action": "ai",
      "config": {
        "agentMode": true,
        "model": "gpt-4o",
        "systemPrompt": "Research competitor pricing changes...",
        "tools": ["http_request"]
      }
    },
    {
      "ref": "send_report",
      "action": "email",
      "config": {
        "to": "[email protected]",
        "subject": "Daily Competitor Report",
        "body": "{{research.output.response}}"
      }
    }
  ],
  "flow": ["research", "send_report"]
}

The worker daemon checks schedules every 60 seconds. Idempotent — won't double-fire in the same minute. Skips if the user has insufficient credits.

See Triggers for cron expression syntax and timezone details.

SDK & MCP Server

TypeScript SDK

TypeScript
import { S6SClient } from "@s6s/sdk";

const client = new S6SClient({
  baseUrl: "https://s6s.ai",
  apiKey: "s6s_your_key"
});

// Deploy and run
const result = await client.deployWorkflow(workflow, {
  autoRun: true,
  waitForCompletion: true
});

// Stream results
for await (const event of client.streamRun(result.runId!)) {
  console.log(event.event, event.data);
}

// Manage
await client.cancelRun(runId);
await client.retryFailed(runId);
const status = await client.getRunStatus(runId);

Full SDK docs: TypeScript SDK

MCP Server (for AI agents)

The MCP server exposes 14 tools so Claude, Cursor, or any MCP-compatible agent can deploy and manage workflows directly.

npx @s6s/mcp-server

Full MCP docs: MCP Server

Practical Examples

Webhook

Contact form + AI + Slack

Website form POSTs to webhook. AI classifies intent (sales/support/spam). Routes to Slack channel or auto-replies.

Webhook

GitHub PR + Tests + Notify

GitHub sends webhook on PR open. Workflow validates metadata, runs checks, posts summary to Slack.

Schedule

Daily competitor monitor

Runs 9 AM weekdays. AI agent scrapes competitor sites, formats digest, emails to team.

REST API

Lead enrichment API

Your CRM calls S6S API with lead email. Workflow enriches data, scores lead, returns result via callback.

Ready to connect?

Deploy your first workflow and get a webhook URL in seconds.