Every Ntropii runbook subclassesDocumentation Index
Fetch the complete documentation index at: https://docs.ntropii.com/llms.txt
Use this file to discover all available pages before exploring further.
NtroWorkflow 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.
Install
[workflow] extra brings in Temporal, all ntro.capabilities.* modules, ntro.events, ntro.accounting, and ntro.data — everything a runbook needs at runtime.
The shape of a runbook
@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.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.
Reference
| Class / decorator | Purpose |
|---|---|
NtroWorkflow | Base class for all runbooks |
@ui_step(name=, title=, icon=) | Mark a method as a step; threads UI metadata |
wait_for_action(payload, display_hint, reason) | Block on a HITL signal |
await_signal_with_action(predicate, action, display_hint) | Block on external signals with UI advertising |
run_child_workflow(slug, input, step_id) | Dispatch another runbook |
current_pending_action (query) | What is the workflow waiting for? |
current_steps (query) | List of @ui_step-tagged steps and their statuses |
current_ui_state (query) | Combined snapshot for the UI |
user_action (signal) | Receives approve/reject/correct from the UI |
Related
Skill definitions
The runbook.md frontmatter that drives
@ui_step placement.Testing
Run your
NtroWorkflow subclass locally with WorkflowHarness.