Using AI Prompts in Action Links and Record Rules
AI Prompts can be integrated into your workflow automation through Action Links and Record Rules, allowing you to automatically process records, generate content, and make intelligent decisions without manual intervention. This guide shows you how to trigger AI Prompts as part of your automation workflows.
Prerequisites
Before using AI Prompts in automation, make sure you have:
- Created at least one AI Prompt in your app's AI Prompts section
- Configured the prompt with appropriate dynamic variables and response fields
- Set the prompt status to "Active"
If you haven't created an AI Prompt yet, learn how to create AI Prompts here.
Using AI Prompts in Record Rules
Record Rules allow you to trigger AI Prompts automatically when certain conditions are met, such as when a record is created, updated, or when specific field values change.
Setting Up AI Prompt in Record Rules
Trigger Options
On Record Creation
- Run AI prompt automatically when a new record is added
- Useful for auto-generating descriptions, classifications, or initial analysis
- Example: Generate product description when new product is added
On Record Update
- Trigger when specific fields are modified
- Set conditions to only run when certain fields change
- Example: Re-categorize support ticket when status changes
On Field Change
- Monitor specific fields and respond to their changes
- Combine with conditional logic for precise control
- Example: Score lead when contact information is updated
Conditional Execution
Add conditions to control when the AI Prompt runs:
- Field Value Conditions - Only run when specific fields equal certain values
- User Role Conditions - Limit to certain user roles
- Date/Time Conditions - Run during specific time periods
- Multiple Conditions - Combine multiple criteria with AND/OR logic
Rule: When a support ticket is created
Condition: If priority field is empty
Action: Trigger AI Prompt "Categorize and Prioritize Ticket"
Result: AI analyzes ticket description and automatically sets category and priority fields
Mapping Dynamic Variables
When configuring the AI Prompt action, you'll need to map the prompt's dynamic variables to actual field values:
- The system shows all dynamic variables defined in your AI Prompt
- For each variable, select which record field should provide the value
- You can use:
- Fields from the current record
- Connected record fields
- Logged-in user fields
- Static values
- If a field is empty, the default value from the prompt will be used
Response Field Mapping
After the AI processes your prompt, map where responses should be saved:
- Each response field from your AI Prompt is listed
- Select which record field should receive each response
- The field types should match (text to text, number to number, etc.)
- Responses are saved directly to the record after AI processing completes
Using AI Prompts in Action Links
Action Links allow you to trigger AI Prompts manually or in batch operations, giving users control over when AI processing occurs.
Setting Up AI Prompt in Action Links
Single Record Processing
Add action links to detail pages or list views to process individual records:
- Users click the action link button
- AI Prompt runs immediately on that specific record
- Results are saved back to the record
- User sees confirmation when complete
Add a "Generate Description" action link button on product detail pages. When clicked, AI creates a professional product description based on the product's specifications and saves it to the description field.
Batch Processing
Enable batch processing to run AI Prompts on multiple records at once:
- Add action link to table view
- Enable "Batch" option
- Users select multiple records
- Click action link to process all selected records
- AI runs on each record sequentially
- Progress indicator shows completion status
Important: Batch processing consumes tokens for each record processed. Large batches may consume significant tokens depending on your prompt complexity.
Confirmation & Feedback
Configure user experience options:
- Confirmation Dialog - Ask user to confirm before running AI
- Success Message - Show custom message when complete
- Loading Indicator - Display progress while AI processes
- Error Handling - Show clear error messages if AI fails
Common Automation Use Cases
Content Generation on Creation
Scenario: Auto-generate email templates when new campaign is created
- Trigger: Record Rule on campaign creation
- AI Prompt: "Create email content for {Campaign Type} targeting {Audience}"
- Result: Email subject and body fields automatically populated
Classification & Routing
Scenario: Categorize and assign support tickets automatically
- Trigger: Record Rule when new ticket submitted
- AI Prompt: Analyze ticket and return category and priority
- Result: Ticket routed to correct team with appropriate urgency
Data Enrichment
Scenario: Enhance lead records with AI-generated insights
- Trigger: Action Link "Enrich Lead"
- AI Prompt: Analyze company info and generate qualification score
- Result: Lead score, industry tags, and notes added to record
Quality Assurance
Scenario: Check content quality before publishing
- Trigger: Record Rule when status changes to "Ready for Review"
- AI Prompt: Check for grammar, tone, and completeness
- Result: Quality score and suggestions saved to record
Bulk Data Processing
Scenario: Update product descriptions for entire catalog
- Trigger: Batch Action Link on products table
- AI Prompt: Generate SEO-friendly description from specs
- Result: All selected products get new descriptions
Best Practices
Automation Design
- Be Selective - Don't run AI on every record update; use specific conditions
- Consider Timing - Some prompts work better on creation, others on update
- Plan for Failures - Have fallback values if AI doesn't return expected results
- Test Thoroughly - Try your automation with various data before enabling
Performance Optimization
- Avoid Loops - Ensure AI response doesn't trigger the same rule again
- Use Conditions - Only run AI when truly needed, not on every change
- Batch Wisely - Process records in reasonable batch sizes
- Monitor Usage - Check logs regularly to track token consumption
User Experience
- Set Expectations - Tell users AI processing may take a few seconds
- Provide Feedback - Show clear loading and success states
- Allow Manual Edits - Let users modify AI-generated content
- Offer Regeneration - Give option to re-run AI if result isn't satisfactory
Troubleshooting
AI Prompt Not Triggering
- Verify prompt status is "Active"
- Check record rule conditions are met
- Ensure user has permission to trigger the rule
- Review error logs for specific issues
Responses Not Saving to Fields
- Confirm response field mapping is correct
- Check field types match (text to text, etc.)
- Verify user has permission to update those fields
- Look for validation rules that might block the update
Inconsistent Results
- Review which dynamic variables are being passed
- Check if source fields sometimes have empty values
- Set appropriate default values in AI Prompt
- Make prompt instructions more specific
Token Limit Issues
- Check AI Prompt Logs to see token usage
- Reduce frequency of automatic triggers
- Optimize prompts to be more concise
- Consider switching some automations to manual action links
Advanced Techniques
Multi-Step AI Workflows
Chain multiple record rules to create sophisticated AI workflows:
- First rule triggers AI to generate content
- Second rule (triggered by first's completion) analyzes that content
- Third rule takes action based on analysis results
Conditional AI Routing
Use different AI Prompts based on record characteristics:
- Create multiple record rules with different conditions
- Each rule triggers a specialized AI Prompt
- Example: Different prompts for different product categories
Human-in-the-Loop
Combine automatic and manual triggers for quality control:
- Record rule auto-generates draft content
- Content saved to "Draft" field
- Human reviews and approves via action link
- Second AI prompt refines based on feedback
Monitoring AI Automation
Keep track of your automated AI workflows:
- AI Prompt Logs - View every AI execution, including trigger source
- Token Usage Reports - Monitor daily consumption by prompt
- Success Rate - Track how often AI returns expected results
- Processing Time - See how long prompts take to complete
- Error Tracking - Identify patterns in failures
We'd love to hear your feedback.