Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

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

  1. Add table name to output
  2. Convert data to binary
  3. Save file locally
  4. Extract data from file
  5. Chat Trigger
  6. When clicking "Test workflow"
  7. Combine schema data and chat input
  8. Load the schema from the local file
  9. Extract SQL query
  10. Check if query exists
  11. Format query results
  12. Combine query result and chat answer
  13. List all columns in a table
  14. List all tables in a database

28 steps in total.

Similar automations