Create Workflow
create-workflowCreates scheduled SQL workflows that run queries automatically and deliver results to HTTP, table, or Slack sinks. Configure cron schedules, pause execution, or set manual-only runs.
Instructions
Create a scheduled SQL workflow. Requires name and query (database and sql). Defaults: schedule={ cron: "* * * * * *", enabled: true }, sinks=[]. An enabled schedule starts recurring SQL execution and sink delivery; use schedule.enabled=false to create it paused, or schedule=null for manual-only. SQL may write rows through INSERT SELECT. Creation is not idempotent: reconcile an uncertain result with list-workflows before retrying. Returns the workflow object: id, name, description, query, schedule, revision, created_at, updated_at, and sinks. The query object contains database and sql. schedule is null for manual-only workflows; otherwise it contains cron, enabled, and next_run_at (null while paused). Each sink has id, type, and settings. HTTP settings contain url (null when unreadable), url_configured, and header_names; header values are never returned. Table settings contain database and table. Slack settings contain integration_id, channel_id, and channel_name, resolved from Slack when the sink was saved. Requires an admin API key bound to the selected organization and cluster, or OAuth. Organization members may read; organization admins may create, update, or delete. Workflows execute with organization credentials and continue after the creating key is revoked or expires.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"organization": "<organization>",
"cluster": "<cluster>",
"name": "<name>",
"query": "<query>"
},
"name": "create-workflow"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| query | Yes | ||
| sinks | No | Up to five sinks. Omit for none. New HTTP sinks require settings.url. Slack sinks post a summary and a preview of the result rows through an organization Slack integration from list-integrations. Give the channel as channel_name (such as "#alerts"), or as channel_id; search channels with list-slack-channels and name. A name is resolved to its channel ID on every save, and only the ID is stored. Each Slack sink must use a distinct integration and channel. All sink IDs are assigned by the API. | |
| cluster | Yes | RawTree cluster to use for this operation. | |
| schedule | No | Omit for the default schedule, "* * * * * *" (every second), enabled. null creates a manual-only workflow. enabled defaults to true. | |
| description | No | Free-form text. The API trims it and stores blank values as null. | |
| organization | Yes | RawTree organization containing the target cluster. |