Custom workflows
Custom workflows
Tenant-defined linear chains of prompt steps. Build at
/admin/legal/custom-workflows. The same engine that runs the
Playbooks — playbooks are just code-curated
versions of what you can author here.
Anatomy
A custom workflow is up to 8 steps, each with:
label: short name shown in the runnersystem_prompt: the system message for that stepuser_template: body of the user message, with placeholdersinput_kind: "text" | "vault_doc" (step 1 only)Placeholders
{{input}} the input the runner provided{{step_1}} output of step 1{{step_2}} output of step 2...Step i can reference {{step_1}}…{{step_(i-1)}} plus {{input}}.
Example
name: "Deal-close memo generator"description: "From a closed-deal summary, produces a partner-facing memo."steps: - label: "Extract milestones" system_prompt: | You are a corporate paralegal. Extract every closing milestone from the input. Output JSON: [{date, milestone, status}]. user_template: "{{input}}" - label: "Risk surface" system_prompt: | You are M&A counsel. Given milestones below, flag any open risk items requiring follow-up. Output bulleted markdown. user_template: "MILESTONES:\n\n{{step_1}}" - label: "Memo draft" system_prompt: | Compose a one-page partner-facing memo summarizing the deal close. Include the milestones, the risk surface, and a recommended next-steps section. user_template: | DEAL SUMMARY:\n{{input}}\n\nMILESTONES:\n{{step_1}}\n\nRISKS:\n{{step_2}}Run it from the same page — paste a deal summary, get the memo.
Why trace
Every step’s LLM call is stamped on the workflow’s Why trace as a
distinct llm_call event. Per-step output also persists to
legal_custom_workflow_runs.steps_output_json.
Limits
- 8 steps per workflow (hard cap)
- Input text capped at 80k chars
- Names tenant-unique