create_workflow
Define and generate macOS Automator workflows by specifying a name, type, and action configurations to automate tasks like executing scripts, organizing files, and sending emails.
Instructions
Create a new Automator workflow file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| actions | No | Array of action configurations | |
| name | Yes | Name of the workflow | |
| type | Yes | Type of Automator document |
Implementation Reference
- src/index.js:247-267 (handler)The handler function that executes the create_workflow tool by generating an AppleScript to create a new Automator workflow.async createWorkflow(args) { // Simplified workflow creation - in real implementation would use Automator's plist format const workflowScript = ` tell application "Automator" make new workflow set name of result to "${args.name}" save result end tell `; await this.runAppleScript(workflowScript); return { content: [ { type: 'text', text: `Created ${args.type} workflow: ${args.name}`, }, ], }; }
- src/index.js:68-93 (schema)Input schema definition for the create_workflow tool, specifying required name and type, and optional actions.inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Name of the workflow', }, type: { type: 'string', enum: ['workflow', 'application', 'service', 'quick-action'], description: 'Type of Automator document', }, actions: { type: 'array', description: 'Array of action configurations', items: { type: 'object', properties: { action: { type: 'string' }, parameters: { type: 'object' }, }, }, }, }, required: ['name', 'type'], },
- src/index.js:65-94 (registration)Tool registration in the ListTools handler, defining name, description, and input schema.{ name: 'create_workflow', description: 'Create a new Automator workflow file', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Name of the workflow', }, type: { type: 'string', enum: ['workflow', 'application', 'service', 'quick-action'], description: 'Type of Automator document', }, actions: { type: 'array', description: 'Array of action configurations', items: { type: 'object', properties: { action: { type: 'string' }, parameters: { type: 'object' }, }, }, }, }, required: ['name', 'type'], }, },
- src/index.js:181-182 (registration)Dispatch registration in the CallToolRequestSchema switch statement.case 'create_workflow': return await this.createWorkflow(args);