Library / AI Agents & Assistants
AI Agents & Assistants
Ask Questions About Emails and Run Claude-Generated SQL
When a chat message arrives, Claude translates your question about emails into a SQL query and runs it against a Postgres database.
What it does
# Translate questions about e-mails into SQL queries and run them ## Overview Automated workflow: Translate questions about e-mails into SQL queries and run them. This workflow integrates 14 different services: convertToFile, stickyNote, agent, readWriteFile, merge. It contains 30 nodes and follows best practices for error handling and security. ## Workflow Details - Total Nodes: 30 - Node Types: 14 - Error Handling: ✅ Implemented - Security: ✅ Hardened (no sensitive data) - Documentation: ✅ Complete ## Node Breakdown - Add table name to output: set - Convert data to binary: convertToFile - Save file locally: readWriteFile - Extract data from file: extractFromFile - Chat Trigger: chatTrigger - Sticky Note: stickyNote - When clicking "Test workflow": manualTrigger - Combine schema data and chat input: set - Load the schema from the local file: readWriteFile - Extract SQL query: set - ... and 20 more nodes ## Usage Instructions 1. Configure Credentials: Set up all required API keys and credentials 2. Update Variables: Replace any placeholder values with actual data 3. Test Workflow: Run in test mode to verify functionality 4. Deploy: Activate the workflow for production use ## Security Notes - All sensitive data has been removed or replaced with placeholders - Error handling is implemented for reliability - Follow security best practices when configuring credentials ## Troubleshooting - Check error logs if workflow fails - Verify all credentials are properly configured - Ensure all required services are accessible
The steps
- Add table name to output
- Convert data to binary
- Save file locally
- Extract data from file
- Chat Trigger
- When clicking "Test workflow"
- Combine schema data and chat input
- Load the schema from the local file
- Extract SQL query
- Check if query exists
- Format query results
- Combine query result and chat answer
- List all columns in a table
- List all tables in a database
28 steps in total.
Similar automations