A workflow is a binding of a runbook (the deterministic Python templates that drive the process) to an entity, optionally on a schedule. A runbook may invoke external agents (Claude Managed, Copilot, …) from inside its steps when it needs LLM-driven artefact generation that doesn’t fit the deterministic capabilities surface. This page is the concept-level walkthrough for authoring a runbook. For API reference, seeDocumentation Index
Fetch the complete documentation index at: https://docs.ntropii.com/llms.txt
Use this file to discover all available pages before exploring further.
ntro.workflow. For the LLM-facing layer of a runbook, see skill definitions. To delegate a step to an external agent, see Register agents.
Anatomy of a runbook bundle
A runbook lives inntro-runbook-templates/runbooks/<slug>/:
/workflows/<slug>/<version>/ for bundles at boot and registers each runbook’s workflow + activities with Temporal. Deploys land under that path via ntro workflow create --path ….
The shape of a runbook
Every runbook subclassesNtroWorkflow and decorates each phase with @ui_step. The decorator both attaches metadata for the Tenant UI breadcrumb and wraps the method so step lifecycle (_current_step_id, _steps_completed) tracks automatically.
@workflow.defncomes fromtemporalio— the workflow runs on Temporal under the hood.@ui_stepcomes fromntro.workflow— it threads UI metadata into the breadcrumb and wires the step lifecycle, so the Tenant UI can render the right component for this step.
__dict__ insertion order). Icons are Lucide names rendered by the Tenant UI.
What NtroWorkflow gives you
Beyond the bare Temporal workflow surface, NtroWorkflow bakes in the patterns runbooks need:
HITL approvals — wait_for_action
HITL approvals — wait_for_action
Block on a human approve / reject / correct signal:The
display_hint tells the Tenant UI which review component to render (extraction review, journal review, NAV signoff, etc.). The signal is dispatched from the UI when the human clicks Approve/Reject.External signals — await_signal_with_action
External signals — await_signal_with_action
Block until an external signal satisfies a predicate, advertising what’s needed via the Useful when the workflow waits for an upload, an email arrival, or any human-driven event that doesn’t have a fixed schedule.
current_pending_action query:Child workflows — run_child_workflow
Child workflows — run_child_workflow
Dispatch another runbook by slug:Children appear as their own progress trees in the Tenant UI under the parent’s step. Cardinality
many lets you fan out and join.External agents — ntro.workflow.agents.invoke
External agents — ntro.workflow.agents.invoke
Delegate a step to a registered external agent (Claude Managed, Copilot, …):The adapter starts a session on the agent’s host platform, polls until terminal, pulls any output files, and persists them to
ingest.submitted_documents with source='agent_output:<agent_id>'. See Register agents for the agent-side lifecycle.UI queries and signals — wired automatically
UI queries and signals — wired automatically
The base class registers
current_pending_action, current_steps, and current_ui_state queries plus the user_action signal handler at construction. Your subclass doesn’t need to do anything — the Tenant UI starts polling them as soon as the workflow exists.Observable results — ntro.events
For values that update over time (extraction results being corrected, journals being adjusted), wrap them in ObservableResult so the Tenant UI can render live updates without re-fetching:
ObservableResult lives in ntro.events and is used by every runbook template’s models.py. It’s the bridge between activity outputs and the UI’s live-update channel.
Related
Skill definitions
The runbook.md / skill.md frontmatter that the platform’s runbook-creation assistant reads when guiding a user through configuring a workflow.
ntro.workflow API reference
Signatures and behaviour of
NtroWorkflow, @ui_step, wait_for_action, await_signal_with_action, run_child_workflow.UI and Temporal signals
How Tenant UI actions reach workflows (
approve, row_action) end-to-end.Ingest contracts
ntro.ingest contracts and set_user_feedback for upload steps.Register agents
Bring an external agent (Claude Managed, Copilot) into a runbook step.
Testing
Run your
NtroWorkflow subclass locally with WorkflowHarness.