openapi: 3.2.0 info: title: LiteLLM workflow management API description: 'Proxy Server to call 100+ LLMs in the OpenAI format. **Customize Swagger Docs** 👉 ```LiteLLM Admin Panel on /ui```. Create, Edit Keys with SSO. Having issues? Try ```Fallback Login``` 💸 ```LiteLLM Model Cost Map```. 🔎 ```LiteLLM Model Hub```. See available models on the proxy. **Docs**' version: 1.102.1 tags: - name: Workflow Management paths: /v1/workflows/runs: post: tags: - Workflow Management summary: Create Workflow Run description: 'Create a new workflow run. Returns run_id and session_id. The caller''s API key token is stored as created_by so that non-admin keys can only see and modify their own runs.' operationId: create_workflow_run_v1_workflows_runs_post security: - APIKeyHeader: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/WorkflowRunCreateRequest' responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' get: tags: - Workflow Management summary: List Workflow Runs description: 'List workflow runs. Filter by workflow_type and/or status. Non-admin callers only see runs created by their own API key.' operationId: list_workflow_runs_v1_workflows_runs_get security: - APIKeyHeader: [] parameters: - name: workflow_type in: query required: false schema: anyOf: - type: string - type: 'null' title: Workflow Type - name: status in: query required: false schema: anyOf: - type: string - type: 'null' title: Status - name: limit in: query required: false schema: type: integer maximum: 250 minimum: 1 default: 50 title: Limit responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/workflows/runs/{run_id}: get: tags: - Workflow Management summary: Get Workflow Run description: Get a workflow run with its most recent event. operationId: get_workflow_run_v1_workflows_runs__run_id__get security: - APIKeyHeader: [] parameters: - name: run_id in: path required: true schema: type: string title: Run Id responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' patch: tags: - Workflow Management summary: Update Workflow Run description: Update status, metadata, or output on a workflow run. operationId: update_workflow_run_v1_workflows_runs__run_id__patch security: - APIKeyHeader: [] parameters: - name: run_id in: path required: true schema: type: string title: Run Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/WorkflowRunUpdateRequest' responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/workflows/runs/{run_id}/events: post: tags: - Workflow Management summary: Append Workflow Event description: 'Append an event to the run''s event log. Also updates run.status if event_type maps to a status. Sequence numbers use optimistic concurrency: on a unique-constraint collision (concurrent append), retries up to _MAX_SEQUENCE_RETRIES times with a fresh MAX+1. The event+status update is atomic in a single DB transaction.' operationId: append_workflow_event_v1_workflows_runs__run_id__events_post security: - APIKeyHeader: [] parameters: - name: run_id in: path required: true schema: type: string title: Run Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/WorkflowEventCreateRequest' responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' get: tags: - Workflow Management summary: List Workflow Events description: Fetch event log for a run, ordered by sequence_number. Default limit 100, max 500. operationId: list_workflow_events_v1_workflows_runs__run_id__events_get security: - APIKeyHeader: [] parameters: - name: run_id in: path required: true schema: type: string title: Run Id - name: limit in: query required: false schema: type: integer maximum: 500 minimum: 1 default: 100 title: Limit responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/workflows/runs/{run_id}/messages: post: tags: - Workflow Management summary: Append Workflow Message description: 'Append a conversation message. Stores full content (not truncated). Uses optimistic concurrency for sequence numbers.' operationId: append_workflow_message_v1_workflows_runs__run_id__messages_post security: - APIKeyHeader: [] parameters: - name: run_id in: path required: true schema: type: string title: Run Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/WorkflowMessageCreateRequest' responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' get: tags: - Workflow Management summary: List Workflow Messages description: Fetch conversation history for a run, ordered by sequence_number. Default limit 100, max 500. operationId: list_workflow_messages_v1_workflows_runs__run_id__messages_get security: - APIKeyHeader: [] parameters: - name: run_id in: path required: true schema: type: string title: Run Id - name: limit in: query required: false schema: type: integer maximum: 500 minimum: 1 default: 100 title: Limit responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type input: title: Input ctx: type: object title: Context type: object required: - loc - msg - type title: ValidationError WorkflowMessageCreateRequest: properties: role: type: string title: Role content: type: string title: Content session_id: anyOf: - type: string - type: 'null' title: Session Id type: object required: - role - content title: WorkflowMessageCreateRequest WorkflowRunCreateRequest: properties: workflow_type: type: string title: Workflow Type input: anyOf: - additionalProperties: true type: object - type: 'null' title: Input metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata type: object required: - workflow_type title: WorkflowRunCreateRequest WorkflowEventCreateRequest: properties: event_type: type: string title: Event Type step_name: type: string title: Step Name data: anyOf: - additionalProperties: true type: object - type: 'null' title: Data type: object required: - event_type - step_name title: WorkflowEventCreateRequest WorkflowRunUpdateRequest: properties: status: anyOf: - type: string enum: - pending - running - paused - completed - failed - type: 'null' title: Status output: anyOf: - additionalProperties: true type: object - type: 'null' title: Output metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata type: object title: WorkflowRunUpdateRequest HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError securitySchemes: APIKeyHeader: type: apiKey description: Bearer token in: header name: x-litellm-api-key