# Workflow Configuration

The workflow config types define how multiple models are connected in a multimodal
pipeline. A [`WorkflowGraph`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-gen-ai-api-configs-workflow.html#qairt.gen_ai_api.configs.workflow.WorkflowGraph) holds a set of
typed [`WorkflowNode`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-gen-ai-api-configs-workflow.html#qairt.gen_ai_api.configs.workflow.WorkflowNode) instances and the
directed edges (connections) between them. Each node carries a
[`WorkflowNodeRole`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-gen-ai-api-configs-workflow.html#qairt.gen_ai_api.configs.workflow.WorkflowNodeRole) that tells the executor
its function (e.g. `IMAGE_ENCODER`, `TEXT_GENERATOR`). Pass the finished graph to
[`from_builders()`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-gen-ai-api-builders.html#qairt.gen_ai_api.builders.workflow_builder.WorkflowBuilder.from_builders) to
build the workflow into a
[`WorkflowContainer`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-gen-ai-api-containers.html#qairt.gen_ai_api.containers.workflow_container.WorkflowContainer).

## WorkflowNodeRole

- *class* qairt.gen\_ai\_api.configs.workflow.WorkflowNodeRole(*value*)

    - Bases: `Enum`

Functional role of a node within a workflow pipeline.

- AUDIO\_ENCODER *= 'audioEncoder'*

    - Processes audio input into features/embeddings.

- DIFFUSION *= 'diffusion'*

    - Applies diffusion-based generation/transformation.

- IMAGE\_DECODER *= 'imageDecoder'*

    - Converts latents to images.

- IMAGE\_ENCODER *= 'imageEncoder'*

    - Processes image input into features/embeddings.

- LATENT\_TRANSFORMER *= 'latentTransformer'*

    - Transforms latent representations.

- LUT\_ENCODER *= 'lutEncoder'*

    - Lookup table encoding.

- TEXT\_ENCODER *= 'textEncoder'*

    - Processes text input into embeddings.

- TEXT\_GENERATOR *= 'textGenerator'*

    - Produces text output.

## WorkflowNode

- *class* qairt.gen\_ai\_api.configs.workflow.WorkflowNode(*\**, *name: str*, *role: [WorkflowNodeRole](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-gen-ai-api-configs-workflow.html#qairt.gen_ai_api.configs.workflow.WorkflowNodeRole)*, *output\_callback\_type: Optional[str] = None*, *path: Optional[PathLike] = None*, *tokenizer\_path: Optional[PathLike] = None*, *config\_path: Optional[PathLike] = None*)

    - Bases: `BaseModel`

A single node in a workflow graph.

Carries the node’s identity and functional role. The `path`,
`tokenizer_path`, and `config_path` fields are optional: they are
populated when constructing a graph for `WorkflowBuilder.from_workflow`
(so the builder knows where to find model artifacts) and left absent once
the build phase is complete.

- *field* config\_path*: Optional[PathLike]*  *= None*

    - Explicit path to the model config file or directory for this node. If omitted, convention-based discovery is used. Only relevant when using WorkflowBuilder.from\_workflow().

- model\_computed\_fields*: ClassVar[dict[str, ComputedFieldInfo]]*  *= {}*

    - A dictionary of computed field names and their corresponding <cite>ComputedFieldInfo</cite> objects.

- model\_config*: ClassVar[ConfigDict]*  *= {}*

    - Configuration for the model, should be a dictionary conforming to [<cite>ConfigDict</cite>][pydantic.config.ConfigDict].

- model\_fields*: ClassVar[dict[str, FieldInfo]]*  *= {'config\_path': FieldInfo(annotation=Union[PathLike, NoneType], required=False, default=None, description='Explicit path to the model config file or directory for this node. If omitted, convention-based discovery is used. Only relevant when using WorkflowBuilder.from\_workflow().'), 'name': FieldInfo(annotation=str, required=True, description='Unique identifier for the node'), 'output\_callback\_type': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Optional callback type for node output'), 'path': FieldInfo(annotation=Union[PathLike, NoneType], required=False, default=None, description='Path to model artifacts. Required for from\_workflow(); absent post-build.'), 'role': FieldInfo(annotation=WorkflowNodeRole, required=True, description='Functional role of the node (lutEncoder, textGenerator, …)'), 'tokenizer\_path': FieldInfo(annotation=Union[PathLike, NoneType], required=False, default=None, description='Explicit path to the tokenizer file or directory for this node. If omitted, convention-based discovery is used. Only relevant when using WorkflowBuilder.from\_workflow().')}*

    - Metadata about the fields defined on the model,
mapping of field names to [<cite>FieldInfo</cite>][pydantic.fields.FieldInfo].

This replaces <cite>Model.__fields__</cite> from Pydantic V1.

- *field* name*: str*  *[Required]*

    - Unique identifier for the node

- *field* output\_callback\_type*: Optional[str]*  *= None*

    - Optional callback type for node output

- *field* path*: Optional[PathLike]*  *= None*

    - Path to model artifacts. Required for from\_workflow(); absent post-build.

- *field* role*: [WorkflowNodeRole](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-gen-ai-api-configs-workflow.html#qairt.gen_ai_api.configs.workflow.WorkflowNodeRole)*  *[Required]*

    - Functional role of the node (lutEncoder, textGenerator, …)

- *field* tokenizer\_path*: Optional[PathLike]*  *= None*

    - Explicit path to the tokenizer file or directory for this node. If omitted, convention-based discovery is used. Only relevant when using WorkflowBuilder.from\_workflow().

## WorkflowGraph

- *class* qairt.gen\_ai\_api.configs.workflow.WorkflowGraph(*\**, *nodes: Tuple[[WorkflowNode](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-gen-ai-api-configs-workflow.html#qairt.gen_ai_api.configs.workflow.WorkflowNode), ...]*, *connections: Tuple[Tuple[str, str, str], ...]*)

    - Bases: `BaseModel`

Directed graph describing the structure of a workflow pipeline.

Holds the complete set of named, typed nodes and the directed edges
(connections) that define how data flows between them.

This is the single graph type used throughout the lifecycle:

- **Pre-build** (`WorkflowBuilder.from_workflow`): nodes carry a `path`
so the builder can locate model artifacts.
- **Post-build** (stored in `WorkflowContainer`): paths are not needed and
may be absent.

The model is intentionally **frozen**: `nodes` and `connections` are
stored as tuples and field reassignment is prohibited.  Any change to the
graph requires constructing a new `WorkflowGraph` instance, which
guarantees that `validate_connections_reference_known_nodes` always runs
against the final state of the data.

- *field* connections*: Tuple[Tuple[str, str, str], ...]*  *[Required]*

    - Tuple of directed edges defining data flow. Each entry is a three-element tuple `(source_node, target_node, connection_type)` where `connection_type` is `'standard'` for role-based connector mapping or `'wildcard'` to use `GENIE_NODE_WILDCARD` for both connectors.

- Validated by

    - - [`validate_connections_reference_known_nodes`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-gen-ai-api-configs-workflow.html#qairt.gen_ai_api.configs.workflow.WorkflowGraph.validate_connections_reference_known_nodes)

- model\_computed\_fields*: ClassVar[dict[str, ComputedFieldInfo]]*  *= {}*

    - A dictionary of computed field names and their corresponding <cite>ComputedFieldInfo</cite> objects.

- model\_config*: ClassVar[ConfigDict]*  *= {'frozen': True}*

    - Configuration for the model, should be a dictionary conforming to [<cite>ConfigDict</cite>][pydantic.config.ConfigDict].

- model\_fields*: ClassVar[dict[str, FieldInfo]]*  *= {'connections': FieldInfo(annotation=Tuple[Tuple[str, str, str], ...], required=True, description="Tuple of directed edges defining data flow. Each entry is a three-element tuple ``(source\_node, target\_node, connection\_type)`` where ``connection\_type`` is ``'standard'`` for role-based connector mapping or ``'wildcard'`` to use ``GENIE\_NODE\_WILDCARD`` for both connectors."), 'nodes': FieldInfo(annotation=Tuple[WorkflowNode, ...], required=True, description='Ordered tuple of node definitions in the pipeline')}*

    - Metadata about the fields defined on the model,
mapping of field names to [<cite>FieldInfo</cite>][pydantic.fields.FieldInfo].

This replaces <cite>Model.__fields__</cite> from Pydantic V1.

- *field* nodes*: Tuple[[WorkflowNode](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-gen-ai-api-configs-workflow.html#qairt.gen_ai_api.configs.workflow.WorkflowNode), ...]*  *[Required]*

    - Ordered tuple of node definitions in the pipeline

- Validated by

    - - [`validate_connections_reference_known_nodes`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-gen-ai-api-configs-workflow.html#qairt.gen_ai_api.configs.workflow.WorkflowGraph.validate_connections_reference_known_nodes)

- *validator* validate\_connections\_reference\_known\_nodes*»* *all fields*

    - Ensure every connection endpoint names a node that exists in *nodes*.

- Raises

    - **ValueError** – if any node name is duplicated, if any connection does
    not have exactly two elements, or if any connection endpoint
    does not match a declared node name.

Last Published: Jun 19, 2026

[Previous Topic
VisionEncoderConfig](https://docs.qualcomm.com/bundle/publicresource/80-87189-2/topics/qairt-gen-ai-api-configs.md) [Next Topic
Modules](https://docs.qualcomm.com/bundle/publicresource/80-87189-2/topics/qairt-gen-ai.md)