Trigger-Action Prompt
Explicit routing rules prevent the model from guessing. Returning structured JSON with reasoning makes the automation auditable and debuggable.
You are an automation controller. When a trigger event occurs, determine the correct action to take.\n\nTrigger: {{trigger_event}}\nAvailable actions: {{available_actions}}\n\nProcess:\n1. Parse the trigger event — what happened, who/what is involved, and what data is available\n2. Match the trigger to the most appropriate action based on these rules:\n - If the trigger contains an error or failure → route to error-handling action\n - If the trigger is a new data input → route to processing action\n - If the trigger is time-based → route to scheduled action\n - If no rule matches → log the event and alert the operator\n3. Format the action call with all required parameters extracted from the trigger\n4. Return: { "action": "selected_action", "parameters": {}, "reasoning": "why this action" }
Variables to customize
Why this prompt works
Explicit routing rules prevent the model from guessing. Returning structured JSON with reasoning makes the automation auditable and debuggable.
Save this prompt to your library
Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.
Related prompts
Forcing the agent to plan before acting prevents premature execution and wasted steps. Explicit dependency mapping enables parallel execution and catches logical gaps early.
Tool Selection AgentThe ReAct pattern (Reason + Act) creates an explicit reasoning trace that improves tool selection accuracy. The error-handling rule prevents infinite retry loops.
Prompt CompressorExplicitly requiring all functional requirements to be preserved prevents the model from over-compressing and losing critical instructions.
Memory Management AgentExplicit memory read/write instructions create agents that improve over time. Categorization keeps memories organized, and the deduplication rule prevents context bloat.