Workflow Action: Generate Response with OpenRouter
Automate AI-Powered Responses in Your Workflows
The Generate Response action enables your CRM workflows to leverage advanced AI models through the OpenRouter integration. This allows you to automatically create dynamic messages, summaries, and other text-based content based on prompts, contact information, and data from your workflow.
What is the Generate Response Action?
This workflow action sends a prompt to an AI model of your choice via OpenRouter. The AI model processes the prompt and generates a response, which is then returned to your workflow. The result is stored as an output variable, which you can use in subsequent steps, such as sending an SMS, an email, or updating a contact record.
Key Benefits
- Access Multiple AI Models: OpenRouter provides a gateway to a variety of AI models, letting you select the best one for each specific task.
- Create Dynamic Content: Generate highly personalized responses by incorporating workflow variables and contact details into your prompts.
- Streamline Automation: Use the generated text in messages, internal notes, or to update fields in the CRM, reducing manual effort.
- Control AI Behavior: Define the AI's role and tone using a system prompt to ensure consistent and appropriate responses.
Prerequisites: Connect Your OpenRouter Account
Before you can use the Generate Response action, you must first connect the OpenRouter integration to your CRM account.
- Go to your CRM's Settings.
- Select Integrations.
- Find and select OpenRouter from the list of available integrations.
- Click Connect.
- Enter your unique OpenRouter API key.
- Click Save to complete the setup.
System Prompt vs. Prompt
When configuring the action, you will define two types of instructions for the AI.
- System Prompt: This defines the AI's overall role, personality, or the rules it should follow. It sets the context for how the AI should behave across all requests.
Example: You are a friendly and concise customer support agent. - Prompt: This is the specific task or question you want the AI to answer. It can include dynamic variables from your workflow.
Example: Write a welcome back message for {{contact.first_name}} who last purchased from us six months ago.
How to Set Up the Generate Response Action
Once the OpenRouter integration is connected, you can add the action to a workflow.
Step 1: Add an Action to Your Workflow
Navigate to Automation → Workflows. Open an existing workflow or create a new one. In the workflow builder, click the Add button to insert a new step. An Actions panel will appear.
Step 2: Select the OpenRouter App
In the Actions panel, click on the Apps tab. Browse the list of installed applications and locate OpenRouter.
Step 3: Choose the Generate Response Action
Click on OpenRouter to see its available actions, and then select Generate Response.
Step 4: Configure the Action
A configuration panel will open with the following fields:
- Action Name: Give the action a descriptive name for easy identification within your workflow (e.g., "Generate Follow-Up SMS").
- System Prompt: Enter instructions that define the AI's role and behavior.
- Prompt: Enter the specific task or question for the AI to generate a response for.
After configuration, save the action. The AI-generated response will be available as a variable for use in the next steps of your workflow.