Lesson 49 lessons

AI Nodes: ChatGPT Integration

The OpenAI / ChatGPT node

Add your OpenAI API key as a credential, drop in the "OpenAI" node, choose "Message a Model", and write a prompt — optionally using data from earlier nodes via expressions (e.g., summarize {{ $json.emailBody }}).

Prompt design inside workflows

Keep prompts inside n8n focused and structured, since the output often feeds directly into the next automation step. Ask for a specific format (e.g., "Respond with only JSON: {summary, sentiment}") so downstream nodes can parse it reliably.

A real example: auto-summarize form submissions

Trigger: new Google Form response → OpenAI node summarizes the free-text answer → Set node formats it → Slack node posts the summary to a channel. This whole automation replaces manual reading of every submission.

Key Takeaways

  • The OpenAI node lets you call ChatGPT directly inside a workflow.
  • Reference data from earlier nodes with expressions in your prompt.
  • Ask for structured output (JSON) when downstream nodes need to parse it.
  • AI nodes turn manual review tasks into fully automated pipelines.

Add an AI summarization step

Take your workflow from Lesson 3 and add an OpenAI node that summarizes the fetched data in one sentence.

Connecting to External APIs