Workflow Runner

Classes

class arshai.workflows.workflow_runner.BaseWorkflowRunner(workflow_config, debug_mode=False, **kwargs)[source]

Bases: IWorkflowRunner

Base implementation of workflow runner with common functionality.

This implementation follows the pattern from the previous project where: - The runner initializes and manages workflow state - The runner delegates to the workflow for execution - The runner handles errors and returns standardized responses

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

Initialize the workflow runner with config and settings.

async execute_workflow(user_id, input_data, callbacks=None, is_streaming=False)[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