Request for Assistance Configuring Slack–OpenAI Workflow in n8n

Hi n8n Support Team,

I hope you’re doing well. I’m in the process of building a Slack chatbot in n8n that uses OpenAI’s GPT-4 to answer employee HR questions strictly from our internal policy documents (Employee Handbook, People Ops Processes & Policies, Recruitment Policy). I’ve set up a webhook, an “If” filter to isolate user messages, and an HTTP Request node to call the OpenAI API, but I’m running into two issues:

  1. Conditional Branching
    My second “If” node (which forwards valid messages to the OpenAI HTTP Request) always evaluates to false, so the request never fires on real Slack messages. I’d appreciate guidance on the correct expression or wiring so that incoming event.body.event.text triggers the true branch.
  2. JSON Body Configuration
    I need help formatting the JSON payload in the HTTP Request node in Expression mode. Specifically, I want to inject:
  • A system message that tells GPT-4 to only use those three PDFs,
  • The user’s Slack text,
    without causing “invalid JSON” errors.

Could you please point me to the best practice or examples for:

  • Setting up the “If” node to pass Slack user messages,
  • Defining a raw JSON body in Expression mode to send messages to OpenAI.

Thank you for any pointers or sample workflows. I’m not a developer by training, so clear, step-by-step instructions would be extremely helpful.

Hey @Angelina_Chakrabarty hope all is well.

Would you like to share your workflow too?