Closed capability sets
Every connector—Stripe, Slack, or an internal API—is an explicit capability. Undeclared calls are rejected at check time.
Forma for Workflows · pre-alpha exploration
Business automations wire billing, support, and chat together—and increasingly, AI agents author or edit them. @forma/workflows is a pre-alpha Forma prelude for Zapier and Workato-style flows with typed step-to-step dataflow and closed capability and error sets, so every Stripe refund or Slack alert is visible in the contract. Prelude checking runs live in the browser sandbox today; durable execution and live Preview Portal runs are planned.
trigger: refund-requested (RefundEvent) │ ▼ [Stripe] errors: [RefundFailed] step: issue-refund → RefundReceipt │ ▼ [Slack] errors: [SlackUnavailable] step: notify-ops → NotificationId │ │ read → project → check → IR ▼ Closed capability & error contract
Pre-alpha exploration · editable prelude in the sandbox
00 The problem
Visual workflow tools store logic in sprawling JSON blobs; hand-written glue scripts import arbitrary SDKs and swallow errors. When a human—or an AI agent—edits a refund automation, reviewers cannot tell at a glance what external services the flow can touch or which failures are handled. Forma makes triggers, steps, capabilities, and error sets part of the checked source.
Workflow contracts
Every capability and failure is declared up front.
@forma/workflows defines workflow, trigger, and step as prelude forms. Each step names the capability it uses (such as Stripe or Slack), the typed value it expects from earlier steps, and the errors it can raise.
A workflow cannot call an undeclared connector or pass an unverified payload into the next step. If a step adds a new service or error, the workflow's contract must reflect it, making privilege escalation impossible to hide in a diff.
(workflow refund-and-notify
:capabilities [Stripe Slack]
:errors [RefundFailed SlackUnavailable]
(trigger refund-requested
:source :stripe-webhook
:payload RefundEvent)
(step issue-refund
:uses Stripe
:input refund-requested
:output RefundReceipt
:errors [RefundFailed])
(step notify-ops
:uses Slack
:input issue-refund
:output NotificationId
:errors [SlackUnavailable]))Agent-authored automations
Review the contract, not a thousand lines of glue.
When an AI agent proposes a new Zapier-style automation, the hardest part is trusting what it can touch. Because Forma has no ambient HTTP or arbitrary npm imports inside workflow logic, the declared capability list is an honest boundary. Reviewers see the entire trigger-to-step dataflow in a single short file.
Today, the sandbox checks the prelude descriptors and starter flow live in your browser. Durable execution, connector adapters, live Preview Portal flow runs, and dry-run replay journals (proposed in RFC 0012 and RFC 0016) are planned rather than shipped.
03 Architecture
The workflow vocabulary lives in a package prelude, separate from whatever durable runner executes the IR.
Every connector—Stripe, Slack, or an internal API—is an explicit capability. Undeclared calls are rejected at check time.
Triggers and steps declare typed inputs and outputs so payload mismatches fail at the offending step rather than mid-run.
Verified workflows project to structured IR suitable for static policy checks, approval gates, or future Effect-based runners.
Inspect and edit @forma/workflows directly in the browser sandbox to prototype your own triggers, connectors, or error policies.
04 Limits
This is a pre-alpha exploration of workflow contracts. The runtime and connector ecosystem are not built yet.
@forma/workflows prelude is a prototype and will evolve as branching, retries, and compensation are designed.05 Fit
Open the Workflows sandbox to edit src/refund-flow.lisp alongside the mounted @forma/workflows prelude and watch how capability and step checks behave.