SWIRLS_
Language

Resources

Define forms, webhooks, and schedules as workflow entry points.

Resources are the entry points for your workflows. Each resource type generates a trigger that starts a graph run. Connect resources to graphs using triggers.

Forms

A form defines an input interface with a JSON Schema for its payload. Swirls generates a UI in the Portal and an API endpoint for each form.

FieldTypeRequiredDescription
labelstringYesDisplay name
descriptionstringNoDescription shown in the Portal
enabledbooleanNoWhether the form is active (default true)
schemajson blockNoJSON Schema for the form payload
form contact_form {
  label: "Contact Form"
  description: "Collect contact information"
  enabled: true
  schema: @json {
    {
      "type": "object",
      "required": ["name", "email", "message"],
      "properties": {
        "name": { "type": "string", "title": "Name" },
        "email": { "type": "string", "title": "Email" },
        "message": { "type": "string", "title": "Message" }
      },
      "additionalProperties": false
    }
  }
}

Webhooks

A webhook defines an HTTP endpoint that accepts external payloads. Webhooks use the same fields as forms.

webhook inbound {
  label: "Inbound Webhook"
  enabled: true
  schema: @json {
    {
      "type": "object",
      "required": ["event", "data"],
      "properties": {
        "event": { "type": "string" },
        "data": { "type": "object" }
      },
      "additionalProperties": false
    }
  }
}

Schedules

A schedule triggers a graph on a cron expression.

FieldTypeRequiredDescription
labelstringYesDisplay name
cronstringYesCron expression
timezonestringNoIANA timezone (e.g. "America/New_York")
enabledbooleanNoWhether the schedule is active
schedule daily_report {
  label: "Daily Report"
  cron: "0 9 * * *"
  timezone: "America/New_York"
  enabled: true
}

Connecting resources to graphs

Resources do not run graphs on their own. You connect a resource to a graph using a trigger. See Triggers for details.

On this page