Slack slash commands AI chat bot
This is a response chatbot in public channels through slash commands. I explain more in detail through the YouTube video, but it's only available in Korean. How it works? When you request the created slash command in Slack, the request comes to the webhook. Then, the Switch Node branches appropriately according to each slash command request. Here, a slash command called /ask is connected to the chatbot, and the chatbot generates answers to the questions asked. The final node responds to the channel. Set up steps Create a Slack app. Add chat:write permission in Slack OAuth&Permissions>Scopes. Create a Command in Slack Slash Commands menu and enter the n8n Webhook node's URL. Complete creating the Slash Commands. Enter the created command in the Switch node. <br /> --- <br /> 슬래시 커맨드를 통한 공개 채널에서의 응답 챗봇 입니다. 유튜브 영상에 더 자세하게 설명 드립니다. 설명 슬랙에 생성한 슬래시 커맨드를 슬랙에서 요청하면 웹훅에 요청이 들어옵니다. 이후 Switch Node에서 각 슬래시 커맨드의 요청에 따라 알맞게 분기합니다. 여기에서는 /ask라는 슬래시 커맨드가 챗봇으로 연결되어 있고, 챗봇에서 질문한 내용의 답변을 생성합니다. 마지막 노드에서 채널로 응답을 합니다. 설정 방법 Slack 앱을 만드세요. Slack OAuth&Permissions>Scopes 에서 chat:write 권한을 추가하세요. Slack Slash Commands 메뉴에서 Command를 생성하고, n8n Webhook 노드의 url을 입력하세요. Slash Slash Commands 생성을 완료하세요. Switch 노드에 생성한 커맨드를 입력하세요.
HubSpot contact email validation with Hunter.io
Workflow: HubSpot Contact Email Validation with Hunter.io Overall Goal This workflow retrieves contacts from HubSpot that have an email address but haven't yet had their email validated by Hunter. It then iterates through each of these contacts, uses Hunter.io to verify their email, updates the contact record in HubSpot with the validation status and date, and finally sends a summary email notification upon completion. How it Works (Step-by-Step Breakdown) Node: "When clicking ‘Test workflow’" (Manual Trigger) Type: n8n-nodes-base.manualTrigger Purpose: Start the workflow manually via the n8n interface. Output: Triggers workflow execution. Node: "HubSpot" (HubSpot) Type: n8n-nodes-base.hubspot Purpose: Fetch contacts from HubSpot. Configuration: Authentication: App Token Operation: Search for contacts Return All: True Filter Groups: Contact HAS_PROPERTY email Contact NOTHASPROPERTY hunteremailvalidation_status Output: List of contact objects. Node: "Loop Over Items" (SplitInBatches) Type: n8n-nodes-base.splitInBatches Purpose: Process each contact one-by-one. Configuration: Options > Reset: false Output: Output 1 to "Hunter" Output 2 to "Send Email" Node: "Hunter" (Inside the loop) Type: n8n-nodes-base.hunter Purpose: Verify email with Hunter.io Configuration: Operation: Email Verifier Email: {{ $json.properties.email }} Node: "Add Hunter Details (Contact)" (HTTP Request - Inside the loop) Type: n8n-nodes-base.httpRequest Purpose: Update HubSpot contact. Configuration: Method: PATCH URL: https://api.hubapi.com/crm/v3/objects/contacts/{{ $('Loop Over Items').item.json.id }} Headers: Content-Type: application/json Body (JSON): json { "properties": { "hunteremailvalidation_status": "{{ $json.status }}", "hunterverificationdate": "{{ $now.format('yyyy-MM-dd') }}" } } Node: "Wait" (Inside the loop) Type: n8n-nodes-base.wait Purpose: Avoid API rate limits. Configuration: Wait for 1 second. Node: "Replace Me" (NoOp - Inside the loop) Type: n8n-nodes-base.noOp Purpose: Junction node to complete the loop. Node: "Send Email" (After the loop completes) Type: n8n-nodes-base.emailSend Purpose: Send summary notification. Configuration: From Email: test@gmail.com To Email: akhilgadiraju@gmail.com Subject: "Email Verification Completed for Your HubSpot Contacts" HTML: Formatted confirmation message Sticky Notes "HubSpot": Create custom properties (hunteremailvalidationstatus, hunterverification_date). "Add Hunter Details": Ensure field names match HubSpot properties. "Wait": Prevent API rate limits. How to Customize It Trigger Replace Manual Trigger with Schedule Trigger (Cron) for automation. Optionally use HubSpot Trigger for new contact events. HubSpot Node Create matching custom properties. Adjust filters and returned properties as needed. Hunter Node Minimal customization needed. HTTP Request Node Update JSON property names if renaming in HubSpot. Customize date format as needed. Wait Node Adjust wait time to balance speed and API safety. Email Node Customize email addresses, subject, and body. Add dynamic contact count with a Set or Function node. Error Handling Add Error Trigger nodes. Use If nodes inside loop to act on certain statuses. Use Cases Clean your email list. Enrich CRM data. Prep verified lists for campaigns. Automate contact hygiene on a schedule. Required Credentials HubSpot App Token Used by: HubSpot node and HTTP Request node Create a Private App in HubSpot with required scopes. Hunter API Used by: Hunter node SMTP Used by: Email Send node Configure host, port, username, and password. --- Made with ❤️ using n8n by Akhil.
Generate & test SQL code with GPT/OpenRouter AI and PostgreSQL sandbox
This is the core AI agent used for queryverify.com. Don't trust complex AI-generated SQL queries without double-checking them in a safe environment. That's where queryverify comes in. It automatically creates a test environment with the necessary data, generates code for your task, runs it to double-check for correctness, and handles errors if necessary. If you enable auto-fixing, queryverify will detect and fix issues on its own. If not, it will ask for your permission before making changes during debugging. In the end, you get thoroughly verified code along with full details about the environment it ran in. Setup It is an embedded chat for the website, but you can pin input data and run it on your own n8n instance. Input data --- sessionId: uuid\_v4. Required to handle ongoing conversations and to create table names (used as a prefix). threadId: string | nullable. If aiProvider is openai, conversation history is managed on OpenAI’s side. This is not needed in the first request—it will start a new conversation. For ongoing conversations, you must provide this value. You can get it from the OpenAIMainBrain node output after the first run. If you want to start a new conversation, just leave it as null. apiKey: string. Your API key for the selected aiProvider. aiProvider: string. Currently supported values: openai, openrouter. model: string. The AI model key (e.g., gpt-4.1, o3-mini, or any supported model key from OpenRouter). autoErrorFixing: boolean. If true, it will automatically fix errors encountered when running code in the environment. If false, it will ask for your permission before attempting a fix. chatInput: string. The user's prompt or message. currentDbSchemaWithData: string. A JSON representation of the database schema with sample data. Used to inform the AI about the current database structure during an ongoing conversation. Please use the '[]' value in the first request. Example string for filled db structure : '{"users":[{"id":1,"name":"John Doe","email":"john.d@example.com"},{"id":2,"name":"Jane Smith","email":"jane.s@example.com"}],"products":[{"productid":101,"productname":"Laptop","price":999.99}]}' --- Make sure to fill in your credentials: Your OpenAI or OpenRouter API key Access to a local PostgreSQL database for test execution You can view your generated tables using your preferred PostgreSQL GUI. We recommend DBeaver. Alternatively, you can activate the “Deactivated DB Visualization” nodes below. To use them, connect each to the most recent successful Set node and manually adjust the output. However, the easiest and most efficient method is to use a GUI. Workflow Explanation We store all input values in the localVariables node. Please use this node to get the necessary data. OpenAI has a built-in assistant that manages chat history on their side. For OpenRouter, we handle chat history locally. That’s why we use separate nodes like ifOpenAi and isOpenAi. Note that if logic can also be used inside nodes. The AutoErrorFixing loop will run only a limited number of times, as defined by the isMaxAutoErrorReached node. This prevents infinite loops. The ExecuteAIresult node connects to the PostgreSQL test database used to execute queries. Guidance on customization This setup is built for PostgreSQL, but it can be adapted to any programming language, and the logic can be extended to any programming framework. To customize the logic for other programming languages: Change instruction parameter in localVariables node. Replace the ExecuteAIresult PostgreSQL node with another executable node. For example, you can use the HTTP Request node. Update the GenerateErrorPrompt node's prompt parameter to generate code specific to your target language or framework. Any workflows built on top of this must credit the original author and be released under an open-source license.