pynenc.workflow.identity

Module Contents

Classes

WorkflowIdentity

Immutable identity of a workflow execution.

API

class pynenc.workflow.identity.WorkflowIdentity[source]

Immutable identity of a workflow execution.

Workflows provide a structured execution context for tasks, enabling complex orchestration and dependency management. Each workflow has a unique identity captured by this class.

Parameters:
  • workflow_task_id – The identifier of the task that defines this workflow

  • workflow_invocation_id – The unique identifier for this specific workflow execution

  • parent_workflow – The parent workflow if this is a subworkflow

workflow_task_id: str

None

workflow_invocation_id: str

None

parent_workflow: Optional[pynenc.workflow.identity.WorkflowIdentity]

None

property workflow_id: str

Get the unique identifier for this workflow.

classmethod from_invocation(invocation: pynenc.invocation.base_invocation.InvocationIdentity) pynenc.workflow.identity.WorkflowIdentity[source]

Create a new workflow identity based on the invocation.

Parameters:
  • invocation – The invocation that defines this workflow

  • parent_workflow – Optional parent workflow if this is a subworkflow

Returns:

A new workflow identity

property is_subworkflow: bool

Check if this workflow is a subworkflow.

to_json() str[source]

Convert the workflow identity to a JSON-serializable dictionary.

classmethod from_json(json_str: str) pynenc.workflow.identity.WorkflowIdentity[source]

Create a WorkflowIdentity from a JSON string.