Skip to content

RunConcurrent

junjo.RunConcurrent

Kind: Class

SDK version: 0.64.0

Documentation channel: Next source preview

RunConcurrent(name: str, items: Sequence[Node | Subflow])

View source

Execute a list of nodes or subflows concurrently.

An instance of RunConcurrent can be added to a workflow graph the same way as any other node. Under the hood it starts one task per child item and waits for them to settle.

If one child fails, Junjo cancels all still-pending siblings and re-raises the original failure. Cancelled siblings are marked as cancelled in telemetry rather than as errors so traces tell the full story of the failure boundary.

The child membership is immutable after construction. Junjo stores items as a tuple so compiled graph snapshots, traversal, telemetry, and visualization stay aligned with the same graph shape.

Name Type Description Default
name str The name of this collection of concurrently executed
nodes.
items Sequence[Node | Subflow] A sequence of nodes or subflows to execute concurrently.
Junjo copies this sequence into an immutable tuple during
construction.

id: str

View source

Returns the unique identifier for the node or subflow.

name: str

View source

Returns the configured name of this concurrent execution group.

items: tuple[Node | Subflow, ...]

View source

Return the immutable child executables for this concurrent group.

service(store: BaseStore) -> None

View source

Execute the provided nodes and subflows concurrently.

Child items receive the same run-local store. If one item fails, all still-pending siblings are cancelled and the original failure is re-raised once the cancellations have been drained.

execute(store: BaseStore, parent_id: str) -> None

View source

Execute the RunConcurrent node with tracing and lifecycle dispatch.

This wraps service with a dedicated run-concurrent span and the same started/completed/failed/cancelled lifecycle semantics used by ordinary nodes.

Name Type Description Default
store BaseStore The run-local store for the current workflow execution.
parent_id str The parent workflow or subflow identifier.