TotalBase
Workflows

Creating a Workflow

The New workflow wizard: identification, trigger, access and run retention.

In the admin: Workflows › New workflow

New workflow, at the top of the Workflows list, opens a wizard. Its steps set what the workflow's Settings hold, so what you choose here is where you'll find it later. When you finish, the workflow is created with only its Start step, and its editor opens.

This page creates Acme's Order completed workflow.

The wizard's Triggering event step: Manual, Database event, Schedule and Webhook.
The wizard's Triggering event step: Manual, Database event, Schedule and Webhook.

A step you've reached can be opened again from the rail on the left. Next waits until the step is complete.

Identification

Field
NameRequired, up to 32 characters, unique. Order completed
DescriptionOptional, up to 128 characters
SlugRequired, proposed from the name until you edit it, unique, up to 32 characters. It's the workflow's address in the HTTP routes: /api/workflows/order-completed/run

Triggering event

Pick one of four cards:

CardRuns
Manualon demand: from the editor, a DataView action, a page of the App or the API
Database eventwhen rows of a table are created, updated or deleted
Scheduleon a recurring schedule
Webhookwhen an external request calls the workflow's endpoint

For Acme's workflow, pick Database event. The trigger can be changed later in Settings › Trigger.

Configuration

The chosen trigger's own fields. The step is titled after the trigger, and required fields must be filled to continue:

TriggerRequired hereDetails
ManualnothingManual
Database eventTable, Events, Execute asDatabase event
Schedulea valid schedule, Time zone, Execute asSchedule
WebhookWait time when Synchronous; Execute as when PublicWebhook

For Order completed: Table work_orders, Events Update, Filter {"status": {"_eq": "COMPLETED"}}, and Execute as left on the proposed Workflows system account.

Access

Roles that may invoke this workflow: a switch per role. Administrators can always invoke any workflow; with no role switched on, only they can.

It matters for workflows someone starts: Manual, Schedule (when started on demand) and Authenticated webhooks. A database event never checks it. Order completed needs no roles. See Settings › Security.

Run retention

Field
Execution historyKeep execution history, on by default. Off, a run is kept only 24 hours after it finishes
History levelDETAILED by default here: each step's input and result are kept, which is what you need while building. SUMMARY keeps only which steps ran, their outcome and errors

See Settings › General for how long each level is kept.

The last step says Creating never activates this workflow: publish it from the editor once its design is ready, then enable it.

With an AI agent. Ask "When a work order is completed, email the dispatch office its resolution". The agent calls create_workflow with the trigger, save_workflow with the steps, tries it with run_workflow in test mode, and publishes it with publish_workflow. See Recipes › A workflow.

What the wizard creates

  • The workflow, disabled and never published, with one Start step holding the trigger you configured.
  • Its invoke grants, for the roles you switched on. They apply at once, but a workflow can't be started on demand until it's published and enabled.
  • Its history policy, as you set it.

If creating fails, such as a name or slug already taken, the wizard stays open with your values.

Errors

CodeWhen
WORKFLOW_NAME_CONFLICT, WORKFLOW_SLUG_CONFLICT (409)another workflow already has the name or the slug
WORKFLOW_INVALID_DESIGN (400)the trigger's configuration can't be valid, such as a database event on a view

See Errors.

Without the wizard

The wizard sends POST /admin/api/workflows with the name, description, slug, history settings and the Start's configuration, then PUT /admin/api/workflows/{id}/roles with the roles. Agents use the MCP tool create_workflow. See Admin API.

Next steps