Iworkflowrunner

Classes

class arshai.core.interfaces.iworkflowrunner.IWorkflowRunner(workflow_config, debug_mode=False, **kwargs)[source]

Bases: Protocol

Interface for workflow runners.

Workflow runners are responsible for initializing workflow state, executing workflows, and handling the results. They act as the bridge between the application and the workflow orchestrator.

__init__(workflow_config, debug_mode=False, **kwargs)[source]

Initialize the workflow runner.

Parameters:
  • workflow_config (IWorkflowConfig) – Configuration for the workflow

  • debug_mode (bool) – Whether to enable debug mode

  • **kwargs (Any) – Additional configuration options

async execute_workflow(user_id, input_data, callbacks=None)[source]

Execute a workflow with the given input.

This method: 1. Initializes workflow state if not provided 2. Prepares input data with state and callbacks 3. Executes the workflow 4. Processes and returns the results

Parameters:
  • user_id (str) – The ID of the user initiating the workflow

  • input_data (Dict[str, Any]) – Input data for the workflow

  • callbacks (Optional[Dict[str, Any]]) – Optional callback functions to be called during workflow execution

Return type:

Dict[str, Any]

Returns:

Dict with workflow execution results including state

async cleanup()[source]

Clean up any resources used by the workflow runner.

Return type:

None