Create Workflow
create-workflowCreate a scheduled SQL workflow. Requires name and query (database and sql). Defaults: schedule={ cron: "* * * * * *", enabled: true }, sinks=[].
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. 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.
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; 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. |