run_workflow
Execute a specific workflow by providing its unique ID, enabling automated processing and task management within the Unstructured API MCP Server environment.
Instructions
Run a specific workflow.
Args:
workflow_id: ID of the workflow to run
Returns:
String containing the response from the workflow execution
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflow_id | Yes |
Input Schema (JSON Schema)
{
"properties": {
"workflow_id": {
"title": "Workflow Id",
"type": "string"
}
},
"required": [
"workflow_id"
],
"title": "run_workflowArguments",
"type": "object"
}
Implementation Reference
- uns_mcp/server.py:391-410 (handler)The main handler function for the MCP tool 'run_workflow'. It is decorated with @mcp.tool() which registers it, takes a workflow_id string parameter, and proxies the call to the UnstructuredClient's run_workflow_async method using RunWorkflowRequest.@mcp.tool() async def run_workflow(ctx: Context, workflow_id: str) -> str: """Run a specific workflow. Args: workflow_id: ID of the workflow to run Returns: String containing the response from the workflow execution """ client = ctx.request_context.lifespan_context.client try: response = await client.workflows.run_workflow_async( request=RunWorkflowRequest(workflow_id=workflow_id), ) return f"Workflow execution initiated: {response.raw_response}" except Exception as e: return f"Error running workflow: {str(e)}"
- uns_mcp/server.py:33-33 (schema)Import of RunWorkflowRequest used internally in the handler for the underlying API call schema.RunWorkflowRequest,