PromptForge
Prompt library

Connecting an LLM to n8n

n8n / HTTP Request nodeAutomation From a course

n8n connects to AI models either through dedicated nodes (OpenAI, Anthropic community nodes) or a generic HTTP Request node calling any model's API.

The prompt

Method: POST. Body (JSON): { "model": "your-model", "messages": [{"role":"system","content":"You summarize support tickets in 1 sentence."},{"role":"user","content":"{{$json.ticket_body}}"}] }. Use an expression to pull the ticket text from the previous node.

What to replace

Swap these placeholders for your own details before running the prompt:

  • {{$json.ticket_body}}your own value

Pro tip: Always add a "Set" node right after the AI call to extract just the fields you need — don't pass the raw API response downstream.

How to use this prompt

  1. Copy the prompt using the button above.
  2. Replace {{$json.ticket_body}} with your own details — the more specific you are, the better the output.
  3. Paste it into n8n / HTTP Request node and run it.
  4. If the answer feels generic, add constraints: audience, length, tone, and what to avoid. That single change fixes most weak output.

Learn the technique

Connecting an LLM to n8n

Module 1 — n8n Basics for AI Workflows · AI Automation with n8n

Related prompts