run_workflow
Execute automated browser workflows for web scraping and data extraction by providing workflow names and required inputs.
Instructions
Execute a specific Autopilot Browser workflow with the provided inputs. Use search_workflows first to find available workflows and their required inputs.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowName | Yes | The name of the workflow to execute | |
| workflowInputs | Yes | Key-value pairs of inputs required by the workflow. The required inputs depend on the specific workflow being executed. |
Implementation Reference
- src/index.ts:50-69 (handler)Core handler function that makes the HTTP POST request to the Autopilot Browser API to execute the specified workflow with given inputs.async runWorkflow(workflowName: string, workflowInputs: Record<string, any>) { const response = await fetch(`${this.baseUrl}/wf/run`, { method: 'POST', headers: { 'x-api-key': this.apiKey, 'Content-Type': 'application/json', }, body: JSON.stringify({ workflowName, workflowInputs, }), }); if (!response.ok) { const errorText = await response.text(); throw new Error(`API Error: ${response.status} ${response.statusText} - ${errorText}`); } return await response.json(); }
- src/index.ts:196-223 (handler)MCP CallToolRequestSchema handler specifically for the 'run_workflow' tool, which extracts arguments and calls the core runWorkflow function.if (request.params.name === "run_workflow") { const { workflowName, workflowInputs } = request.params.arguments as { workflowName: string; workflowInputs: Record<string, any>; }; try { const result = await apiClient.runWorkflow(workflowName, workflowInputs); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error executing workflow: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; }
- src/index.ts:145-159 (schema)Input schema definition for the 'run_workflow' tool, specifying workflowName and workflowInputs as required parameters.inputSchema: { type: "object", properties: { workflowName: { type: "string", description: "The name of the workflow to execute", }, workflowInputs: { type: "object", description: "Key-value pairs of inputs required by the workflow. The required inputs depend on the specific workflow being executed.", additionalProperties: true, }, }, required: ["workflowName", "workflowInputs"], },
- src/index.ts:142-160 (registration)Tool registration metadata including name, description, and input schema returned by ListToolsRequestSchema handler.{ name: "run_workflow", description: "Execute a specific Autopilot Browser workflow with the provided inputs. Use search_workflows first to find available workflows and their required inputs.", inputSchema: { type: "object", properties: { workflowName: { type: "string", description: "The name of the workflow to execute", }, workflowInputs: { type: "object", description: "Key-value pairs of inputs required by the workflow. The required inputs depend on the specific workflow being executed.", additionalProperties: true, }, }, required: ["workflowName", "workflowInputs"], }, },