This workflow corresponds to n8n.io template #5871 — we link there as the canonical source.
This workflow follows the Agent → Form Trigger recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "xgtoa8r5NBx43ldC",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Automated Food Recipe Assistant via Gmail, Form & AI Chat Model",
"tags": [],
"nodes": [
{
"id": "2825d5b3-bc93-4c3f-979b-9f4db3ed4198",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-80,
-180
],
"parameters": {
"height": 540,
"content": "Starts when user sends a Gmail or submits a form with recipe request"
},
"typeVersion": 1
},
{
"id": "a7b23e86-2fc1-4591-bf52-99aa637aef1c",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
220,
-180
],
"parameters": {
"color": 3,
"width": 280,
"height": 620,
"content": "Understands user query and generates recipe."
},
"typeVersion": 1
},
{
"id": "4e8e32c7-f6bc-4810-b390-f5e28ee7df74",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
540,
-180
],
"parameters": {
"color": 5,
"width": 180,
"height": 520,
"content": "Formats the recipe (e.g., ingredients, steps)"
},
"typeVersion": 1
},
{
"id": "503dd57d-ea7c-425d-a12c-8c7ff01d68c2",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
760,
-180
],
"parameters": {
"color": 4,
"width": 200,
"height": 520,
"content": "Sends formatted recipe back to the user."
},
"typeVersion": 1
},
{
"id": "cc323bc4-2d4a-4ffc-9c03-b660309676ff",
"name": "Recipe Request - Gmail",
"type": "n8n-nodes-base.gmailTrigger",
"position": [
0,
0
],
"parameters": {
"filters": {},
"pollTimes": {
"item": [
{
"mode": "everyX",
"unit": "minutes"
}
]
}
},
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "39138c17-7dd2-4d25-acdb-093ac7241c68",
"name": "Recipe Request - Web Form",
"type": "n8n-nodes-base.formTrigger",
"position": [
0,
200
],
"parameters": {
"options": {},
"formTitle": "\ud83c\udf73 Ask the AI Chef!",
"formFields": {
"values": [
{
"fieldLabel": "Hey Dude, Tell Me fast.",
"placeholder": "\"What is a pizza recipe?\",\"How do I make butter chicken?\"",
"requiredField": true
}
]
},
"formDescription": "\u2728 Type any food name, ingredient, or dish, and our AI Chef will give you the perfect recipe in seconds!"
},
"typeVersion": 2.2
},
{
"id": "077be9f8-16cf-4c0e-9564-b4f4ffd51b7f",
"name": "Ollama Recipe Generator",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
220,
100
],
"parameters": {
"text": "=You are a vibrant and professional chef AI tasked with creating a delicious, visually appealing recipe based on user inputs. The user has provided:\n\nQuestion: {{ $json.snippet }}\nIngredients: [Insert ingredients from form submission]\nRecipe Details: [Insert recipe details, e.g., dish name, cuisine type, dietary preferences]\nSpecial Add-Ons: [Insert special add-ons, e.g., garnishes, sauces, or twists]\n\nYour task is to:\n\nCreate a complete recipe using the provided ingredients and special add-ons.\n\nAlign the recipe with the recipe details (e.g., cuisine, dietary preferences).\n\nGenerate a catchy, descriptive title for the dish.\n\nList all ingredients with estimated quantities. Write each on a new line with no symbols or formatting characters (do not use *, -, #, or any bullet points \u2014 just plain text).\n\nProvide clear, step-by-step cooking instructions written for a beginner cook. Use numbered steps only (e.g., 1, 2, 3) with no other symbols before or after the numbers.\n\nIncorporate the special add-ons creatively, such as in garnishes, sauces, or flavor twists, listed clearly without any symbols or formatting characters.\n\nSuggest one side dish or pairing to complement the recipe with a short description.\n\nUse emojis to make the output fun and engaging (e.g., \ud83c\udf55 for pizza, \ud83d\udd25 for spicy, \ud83e\udd57 for sides), but do not overuse them.\n\nFormat the output in Markdown using the structure below. Do not use bold (`**`) or heading (`#`) symbols anywhere in the output. Instead, write section titles in uppercase letters only.\n\nEnsure the output is concise, professional, and visually appealing with thoughtful emoji use.\n\nIf ingredients are unclear or incompatible, suggest minor adjustments and list them under a Chef\u2019s Note section.\n\nOutput Format (in Markdown):\n\n\ud83c\udf7d\ufe0f [RECIPE TITLE]\n\nSERVINGS: [Estimate, e.g., 2-4] \ud83d\udc65 \nCOOk TIME: [Estimate in minutes] \ud83d\udd25\n\nINGREDIENTS \n\u272a.Ingredient 1 with quantity \n\u272a.Ingredient 2 with quantity \n...\n\nINSTRUCTIONS \n1. Step one \n2. Step two \n...\n\nSPECIAL ADD-ONS \n- Describe how add-on 1 is used \n- Describe how add-on 2 is used \n...\n\nSUGGESTED PAIRING \n- Side dish or pairing suggestion with brief description\n\nCHEF\u2019S NOTE (if applicable) \n- Note any substitutions, adjustments, or tips\n\nRULES\n- Bold all main section titles like INGREDIENTS, INSTRUCTIONS, SPECIAL ADD-ONS, SUGGESTED PAIRING, and CHEF\u2019S NOTE using double asterisks (e.g., INGREDIENTS) but do not bold anything else.\n\n- strictly follow output formate \n\n-Make the output visually delightful by adding a few more relevant emojis to enhance each section's personality and structure. Use line spacing and section breaks to make the output look well-organized, professional, and scroll-stopping for email readers. Ensure it feels premium, exciting, and clear.\n\n\nEnsure no symbols (*, -, #, or **) are used in the ingredient list, special add-ons, or instructions. Each item must be on a new line without any prefix symbols.\n",
"options": {},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "45e7c74a-c0d0-4d7e-95b5-4a75c20b220d",
"name": "Llama 3.2 - Chef Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOllama",
"position": [
300,
320
],
"parameters": {
"model": "llama3.2-16000:latest",
"options": {}
},
"credentials": {
"ollamaApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "df6b755f-fa56-4b3a-bae3-3c606e4250ec",
"name": "Format Recipe Output",
"type": "n8n-nodes-base.code",
"position": [
580,
100
],
"parameters": {
"jsCode": "const raw = $json[\"output\"] || \"\";\n\nfunction formatSection(title, content) {\n if (!content) return \"\";\n return `<strong>${title}</strong><br>${content}<br><br>`;\n}\n\n// Replace \\n with <br> for final formatting\nlet html = raw.replace(/\\n/g, \"<br>\");\n\n// Extract section content from RAW text\nfunction extractFromRaw(title) {\n const regex = new RegExp(`${title}\\\\s*:?\\\\s*\\\\n([\\\\s\\\\S]*?)(\\\\n\\\\n|\\\\n[A-Z ]{3,}|$)`, \"i\");\n const match = raw.match(regex);\n return match && match[1] ? match[1].trim().replace(/\\n/g, \"<br>\") : \"\";\n}\n\n// Extract Servings and Cook Time\nfunction extractDetails() {\n let servingsMatch = raw.match(/Servings\\s*[:\\-]?\\s*(.+)/i);\n let cookTimeMatch = raw.match(/Cook\\s*Time\\s*[:\\-]?\\s*(.+)/i);\n let servings = servingsMatch ? `SERVINGS: ${servingsMatch[1].trim()} \ud83d\udc65` : \"\";\n let cookTime = cookTimeMatch ? `COOK TIME: ${cookTimeMatch[1].trim()} \ud83d\udd25` : \"\";\n return [servings, cookTime].filter(Boolean).join(\"<br>\");\n}\n\n\n// Title Line \u2014 also handles **Markdown bold** if exists\nconst firstLineRaw = raw.split(\"\\n\")[0].replace(\"\ud83c\udf7d\ufe0f \", \"\").trim();\nconst firstLine = firstLineRaw.replace(/\\*\\*(.*?)\\*\\*/g, \"<strong>$1</strong>\");\n\nconst formatted = `\n<div style=\"font-family:Arial, sans-serif; line-height:1.6\">\n <p>\ud83c\udf7d\ufe0f ${firstLine}</p><br>\n ${formatSection(\"DETAILS\", extractDetails())}\n ${formatSection(\"INGREDIENTS\", extractFromRaw(\"INGREDIENTS\"))}\n ${formatSection(\"INSTRUCTIONS\", extractFromRaw(\"INSTRUCTIONS\"))}\n ${formatSection(\"SPECIAL ADD-ONS\", extractFromRaw(\"SPECIAL ADD-ONS\"))}\n ${formatSection(\"SUGGESTED PAIRING\", extractFromRaw(\"SUGGESTED PAIRING\"))}\n ${formatSection(\"CHEF'S NOTE\", extractFromRaw(\"CHEF'S NOTE\"))}\n</div>\n`;\n\nreturn [\n {\n json: {\n formattedHtml: formatted\n }\n }\n];\n"
},
"typeVersion": 2
},
{
"id": "11c32fd2-8844-410e-bbae-a81e267f34da",
"name": "Send Recipe via Email",
"type": "n8n-nodes-base.gmail",
"onError": "continueRegularOutput",
"position": [
800,
100
],
"parameters": {
"sendTo": "={{ $('Recipe Request - Gmail').item.json.To }}",
"message": "={{ $json.formattedHtml }}",
"options": {
"appendAttribution": false
},
"subject": "\ud83d\udd25 Ready to Cook? Here\u2019s Your Recipe from AI Chef"
},
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"executeOnce": true,
"typeVersion": 2.1,
"alwaysOutputData": true
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "8bf21cb0-edf4-4908-9c46-46363df9ade8",
"connections": {
"Format Recipe Output": {
"main": [
[
{
"node": "Send Recipe via Email",
"type": "main",
"index": 0
}
]
]
},
"Llama 3.2 - Chef Model": {
"ai_languageModel": [
[
{
"node": "Ollama Recipe Generator",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Recipe Request - Gmail": {
"main": [
[
{
"node": "Ollama Recipe Generator",
"type": "main",
"index": 0
}
]
]
},
"Ollama Recipe Generator": {
"main": [
[
{
"node": "Format Recipe Output",
"type": "main",
"index": 0
}
]
]
},
"Recipe Request - Web Form": {
"main": [
[
{
"node": "Ollama Recipe Generator",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
gmailOAuth2ollamaApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This n8n template demonstrates how to create an intelligent food recipe assistant that accepts requests via Gmail and web forms, processes them using AI chat models (Ollama and Llama 3.2), and delivers personalized recipes back to users. The system combines multiple input…
Source: https://n8n.io/workflows/5871/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
AI Agents Vs AI Workflow. Uses lmChatOpenAi, gmailTrigger, gmail, gmailTool. Event-driven trigger; 30 nodes.
This workflow is built for professionals, founders, freelancers, and anyone drowning in email who wants to automatically triage their inbox using AI — sorting emails into categories, applying Gmail la
This workflow turns your website form into a fully automated AI Lead Qualification system. Whenever a new lead submits your form, the workflow: Receives the submission through a Webhook Cleans and nor
This workflow is ideal for:
4452. Uses lmChatOpenAi, outputParserStructured, googleDriveTrigger, googleDrive. Event-driven trigger; 17 nodes.