Workflows

A workflow in ProvenanceOne is a directed acyclic graph (DAG) of steps that defines an automation. It specifies what triggers execution, what steps run in what order, and what happens when a step succeeds, fails, or requires human review. The workflow is the blueprint — it does not run by itself. Each time the trigger fires, ProvenanceOne creates a run: a live execution of the workflow against a specific input.

Workflows are not restricted to linear sequences. You can branch on logic conditions, run steps in parallel, embed approval gates, and compose agents, skills, and MCP server calls in any topology the DAG supports.


When to use workflows

Use a workflow any time you need to coordinate more than one automated step, or when you need to enforce ordering, approvals, or conditional logic around AI agent calls. Workflows are particularly valuable when:

  • An AI agent needs to take consequential actions (deleting records, sending bulk messages) and you need a human-in-the-loop gate before those actions execute
  • You are pulling data from one system, transforming it, and writing it to another on a schedule
  • You need an auditable, versioned record of what ran, when, with what inputs, and what the agent decided

Key concepts

Workflow vs. run — the workflow is the definition (what to do); the run is the execution (what happened). A single workflow can have hundreds of runs. Each run records which workflow version was active when it started.

DAG — each workflow is a directed acyclic graph. Nodes are steps; edges define data flow and execution order. Cycles are not permitted — a step cannot depend on itself.

Version — every call to POST /workflows/{workflowId}/publish creates an immutable version (v1, v2, … v14, etc.). The draft workspace is separate from published versions. Runs always reference the version that was live when the run started.

Draft vs. deployed — the visual editor always operates on the draft. Publishing the draft produces a new immutable version without affecting runs in progress under the previous version.

Environment — workflows are deployed to production, staging, or development. Use separate environments to test changes before promoting to production.


How it works

Workflow lifecycle

A workflow moves through the following statuses:

  • draft — being edited; not executable. The visual editor saves drafts automatically.
  • deployed — a published version is active; the workflow can accept trigger events and start runs.
  • paused — deployed but not accepting new trigger events. Runs in progress continue.
  • failed — the platform detected a configuration or infrastructure error that prevents the workflow from operating. Inspect the workflow for misconfigured steps.
  • approval — the workflow itself is pending an administrative approval before it can be deployed.

Publishing

Publish a draft by clicking Publish in the editor or calling POST /workflows/{workflowId}/publish. Each published version is immutable. The workflow version field increments by one. If you need to change the workflow, edit the draft and publish again.

Trigger types

A workflow has exactly one trigger, defined in the trigger step. The six trigger types are:

TriggerHow it fires
webhookAn HTTP POST to the workflow's unique inbound URL. The request body becomes the run's initial payload.
scheduleA cron expression or interval. ProvenanceOne fires the trigger at the defined time in the configured timezone.
manualA user clicks Run in the UI or calls the runs API directly. Useful for testing and for workflows that should not fire automatically.
eventA named event on the ProvenanceOne event bus (e.g. approval.granted, run.failed). The event payload is passed to the workflow.
apiA call to POST /runs with the workflow ID. Similar to manual but designed for programmatic invocation from external systems.
queueA message arrives on a configured queue integration. The message body becomes the run payload.

Step kinds

Each node in the DAG is a step with a kind. The ten step kinds are:

KindPurpose
triggerThe entry point of every workflow. Exactly one per workflow. Defines how the run starts and what initial data is available.
dataReads from or writes to a datastore (database, object store, etc.). Use for structured data lookups or persistence.
skillCalls a ProvenanceOne skill — a sandboxed serverless function with a defined input schema. Use for repeatable, testable data operations.
agentInvokes an AI agent. The agent receives context from upstream steps and may call tools (skills, MCP servers). Agent steps are probabilistic; design surrounding steps accordingly.
mcpCalls a specific tool on a registered MCP server, routed through the MCP Gateway proxy.
logicA conditional branch or loop. Routes execution to different downstream steps based on field values or expressions.
approvalPauses the run and sends a human-in-the-loop approval request. Execution resumes only when an assignee approves or rejects.
actionCalls an external service (e.g. create a CRM record, send an HTTP request). Distinct from skill in that actions are simpler, direct integrations without a sandbox.
notifySends a notification — email, Slack, or webhook — to one or more recipients.
storageReads from or writes to object storage (e.g. object storage). Use for files, large blobs, or structured exports.

Configuration options

Workflow fields

FieldTypeRequiredDefaultDescription
namestringYesHuman-readable workflow name
descriptionstringNoShort description shown in the list view
statusenumdraftdraft | deployed | paused | failed | approval
triggerenumYeswebhook | schedule | manual | event | api | queue
triggerDetailobjectVariesTrigger-specific config (e.g. cron expression for schedule)
versionstringv1Set by the platform on publish; increments with each publish
ownerstringYesUser email of the workflow owner
tagsstring[]No[]Free-form tags for filtering
teamstringNoTeam the workflow belongs to
environmentenumYesproduction | staging | development

Contains flags

The workflow list shows four flags for each workflow, derived from its step composition: Agent, Mcp, Skill, Approval. These are computed; you cannot set them directly.

Metrics fields (read-only)

FieldDescription
lastRunTimestamp of the most recent run
lastRunStatusStatus of the most recent run
successRatePercentage of runs that ended in succeeded over the last 30 days
runs7dNumber of runs in the last 7 days

Examples

Support escalation (agent + approval)

  1. Trigger: webhook — receives a new support ticket
  2. Agent step: classify ticket severity and draft a response
  3. Logic step: if severity is high, route to approval; otherwise continue
  4. Approval step: human reviews the agent's draft and approves or edits
  5. Action step: post the approved response to the ticketing system

Scheduled data sync (schedule + skill)

  1. Trigger: schedule — daily at 02:00 UTC
  2. Skill step: extract records from the source database
  3. Skill step: transform and validate the records
  4. Data step: upsert into the destination datastore
  5. Notify step: email summary to the data team

Event-driven enrichment (event + agent)

  1. Trigger: eventrun.completed from a sibling workflow
  2. Data step: fetch the completed run's output payload
  3. Agent step: enrich the data with external knowledge
  4. Storage step: write the enriched result to object storage

Common mistakes

  • Creating linear workflows when parallel branches would be faster. If two skills fetch independent data, connect them both to the same upstream step and they will execute concurrently.
  • Skipping the approval step on high-risk agent actions. Agents are probabilistic — they can and do make mistakes. Insert approval steps before irreversible actions.
  • Editing a deployed workflow and expecting changes to take effect immediately. Changes only take effect after you publish the draft as a new version.
  • Using production for initial testing. Always validate in development or staging first.
  • Leaving workflows in paused status indefinitely. A paused workflow will not process incoming trigger events. Queued triggers are not replayed when the workflow resumes.

Troubleshooting

Workflow stuck in approval status — a workflow-level approval is pending. Check the Approvals page and action it.

Trigger not firing on schedule — verify the cron expression and confirm the timezone setting. Confirm the workflow is in deployed status, not paused.

Webhook trigger not receiving events — the inbound webhook URL rotates on each publish. Update the URL in the external system after every publish.

Run starts but fails immediately on the trigger step — the trigger payload may not match the schema the first downstream step expects. Check the step's input mapping configuration.


Security and permissions

  • editor and admin roles can create, edit, and publish workflows.
  • viewer can view workflows and runs but cannot modify anything.
  • Audit events workflow.edited, workflow.published, and workflow.draft_saved are emitted on each corresponding action.
  • Workflows are scoped to a workspace. Members cannot see or trigger workflows in workspaces they are not members of.


FAQ

What is the difference between a workflow and a run?

A workflow is the blueprint — it defines the steps, trigger, and logic. A run is a single execution of that blueprint against a specific input. One workflow can produce many runs. Each run records the workflow version that was active when the run started.

Can I change a workflow while runs are in progress?

Yes. Editing the draft does not affect runs in progress. In-progress runs always execute against the version they started with. Publishing a new version only affects runs that start after the publish.

How many versions can a workflow have?

There is no hard cap documented in the platform. Versions increment from v1 upward with each publish. All versions are retained and referenced by the runs that used them.

What happens if a step fails mid-workflow?

The run transitions to `failed` status unless the step is configured with retry logic or an error branch. You can replay the run from the Runs page after fixing the underlying issue.

Can I run the same workflow in multiple environments simultaneously?

Yes. Workflows are scoped to an environment. You can have separate deployed versions of the same logical workflow in `production`, `staging`, and `development`.