An AI Agent ... To Answer Your Parenting Questions - N8N Config & Setup

Configuring an agent that can deliver age-specific parenting information delivered straight to users' inbox

An AI Agent ... To Answer Your Parenting Questions - N8N Config & Setup

Building reliable parenting advice systems presents fascinating technical challenges.

How do you create an AI that can provide evidence-based guidance that's contextually relevant to specific developmental stages?

How do you ensure scientific accuracy while keeping responses accessible and actionable? And perhaps most importantly, how do you deliver immediate, trustworthy answers when parents need them most?

The core technical puzzle I set out to solve involved creating a system that could:

- Process both voice and text inputs seamlessly - Dynamically calculate and contextualize child development data with precision - Generate responses grounded in current scientific literature - Deliver outputs through multiple channels with appropriate formatting

This blog documents the latest iteration (V2) of an agent configuration that I built for my growing family (now my wife plus one!).

Meet An AI Agent Parenting Coach

What I built is an AI-powered parenting consultant—a character-driven system featuring a retired pediatrician who provides evidence-based medical and developmental guidance.

Think of it as having a knowledgeable pediatrician available 24/7, one who never gets tired of answering questions and always has the latest research at their fingertips.

The system demonstrates some interesting innovations: automatic age calculation that eliminates AI math errors, sophisticated prompt engineering that ensures consistent expertise, and a dual-output architecture that serves both immediate needs and long-term knowledge management.

This is the current workflow in N8N showing the three core stages from prompt receipt through to inference and documentation:

  • Prompt capture: this is currently implemented via a responsive and custom authenticated frontend but the input node could be substituted for just about anything: think Telegram bot, Slack channel, Tally.so form, Typeform .. you name it.

  • AI Agent: The prompt gets sent to an LLM. A dynamic Javascript snippet passes the child's date of birth. The system prompt and JSON schema tightly control the behavior and output format.

  • Output capture: The agent's inference is funneled into three capture systems: An email notification pulls the Gmail friendly output from the agent and injects it into a pre-constructed template; the interaction gets written to a Postgres database; it gets stored in a wiki (Nuclino) for easy later retention and reading. To my mind, this solves quite comprehensively my long-standing criticism of consumer conversational AI systems: Output retention is an afterthought at best. This approach ensures that valuable outputs, even if they need human review and refinement, get captured reliably.

The latest workflow with annotations showing the three core stages

The latest workflow with annotations showing the three core stages

Technical Architecture Overview

1. Multi-Modal Input Processing

output-chain

The front end that I developed is a lightweight data entry collector. It has a toggle for the user (my wife or I). This variable gets added to the webbook response so that the outputs can be addressed to the right parent.

I developed the frontend using my go-to agentic code-development combo: Windsurf + Sonnet 4.

It looks (currently!) like this:

frontend

After sending the prompt the user gets a success message:

frontend-success

I added a testing toggle. Under the hood, it changes the webhook the backend sends the form completion to from production to testing:

toggle

2. Dynamic Age Calculation

Every single agent workflow that I create proves to be a learning experience.

A common learning is that the name of the game is currently: "think modular."

Get your agents to do one thing and one thing well. Chaining multiple configurations into multi-agent workflows does involve complication on the surface. But ultimately setting these up usually proves to be a worthwhile time investment. Modularization is the name of the game.

An example: I tried to add logic for calculating our newborn's age into the system prompt before getting back responses like: "at four years old...". The culprit? The annoying complexities of date formatting (the agent was provided with an ISO form completion timestamp and a 'human friendly' date of birth).

The solution? A standalone JavaScript node for computing the date of birth and then injecting that into the constructed user prompt for the agent to complete.

javascript
const dateOfBirth = new Date('2025-05-01'); // Static DOBconst today = new Date($now); // Dynamic today value
// Calculate difference in millisecondsconst diffMs = today - dateOfBirth;
// Convert to full daysconst ageInDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
// Store resultreturn [  {    json: {      ageInDays    }  }];

This change has effectively solved the problem.

Just be mindful of the small details: I added to the constructed prompt that the age unit being provided was days:

age-in-days

3. Intelligent Prompt Construction

The user prompt gets constructed by expressions and is provided to the agent as follows:

text
1The user's question:
2
3{{ $json.prompt }}
4
5David's age today (in days) is:
6
7{{ $json.ageInDays }}

System Prompt Components

The system prompt defines the operational parameters including:

  • Character Definition: I gave my AI agent paediatrician a slightly offbeat personality. He's a donkey (inspired by a beloved stuffed animal of our newborn!).

  • Response Scope: Medical and developmental guidance within defined boundaries

  • Geographic Adaptation: Healthcare system and cultural context integration

  • Output Structure: Standardized response format with scientific citation

  • Safety Protocols: Medical disclaimer and emergency guidance parameters

The hardest part of using large language models in structured output workflows is actually getting the models to adhere to a defined JSON schema. So far my success is somewhat hit and miss. With the note that OpenAI and Gemini seem to be the best at adhering to the schema.

The quick fix, in N8N, is to use an auto-fixing structured output node.

This basically evaluates the parsed output received from the LLM and if it doesn't adhere to the desired or stated schema then it returns it for a second go. This is a somewhat hacky implementation however. The best results are achieved by making direct API calls to LLMs and passing the structured output parameter (see: OpenAI Assistants Docs).

structured-fixer
System Prompt

You are Dr. Herman Poppleberry, a retired pediatrician who, in a curious twist of fate, is also a donkey. While your donkeyhood may lend a unique tone to your voice, it must never eclipse the clarity and professionalism of your parenting guidance.

You are tasked with providing scientifically grounded, emotionally supportive, and practically implementable parenting advice in response to user prompts.


STRUCTURED OUTPUT FORMAT (MANDATORY)

You must return only a JSON object matching the schema below.

All fields are required. Use proper link formatting in both markdown and html_gmail_safe.

the prompt_summary must begin with
 Daniel asked: followed by a concise summary of the user’s request.

Family Context

  • Location: Urban setting with access to national healthcare system

  • Parents: First-time caregivers

  • Healthcare Reference: National pediatric guidelines (based on WHO, AAP, MoH)


CONTENT DIRECTIVES

Scientific Rigor

  • Cite studies with methodology and sample sizes

  • Include evidence grading (A/B/C-level)

  • Reference systematic reviews and meta-analyses

  • Acknowledge and explain conflicting research

  • Provide confidence levels for recommendations

Practical Implementation

  • Step-by-step procedures

  • Troubleshooting guides for common obstacles

  • Lists of required materials

  • Timelines and duration expectations

  • Anticipated implementation challenges and solutions

Educational Explanation

  • Explain the why with biology and development

  • Describe mechanisms and patterns

  • Relate to broader developmental principles

  • Address common myths with well-supported corrections

Emotional Support

  • Validate caregiver concerns

  • Normalize common experiences

  • Build confidence and self-efficacy

  • Provide perspective on natural variation

  • Suggest supportive resources


STRUCTURE OF RESPONSE

1. Understanding Your Concern

Warm, empathetic framing of the issue.

2. The Science Behind It

Evidence from primary literature and guidelines, including confidence levels.

3. Why This Happens

Biological or developmental explanation.

4. What’s Normal vs. Concerning

Clear comparisons and data-based reassurance.

5. Step-by-Step Guidance

Specific instructions with contingencies and expected outcomes.

6. Building Your Confidence

Affirmation of abilities and motivational framing.


Optional Sections (Include When Relevant)

  • National Healthcare Context

  • Research Conflicts Explained

  • Common Misconceptions Addressed

  • Developmental Connections

  • Support Resources


CONCLUSION

  • Evidence summary

  • Practical takeaway

  • Timeline expectations

  • Next steps

  • Emotional reassurance

  • Reminder of support

  • Herman’s final word of wisdom


SOURCING HIERARCHY

Use embedded links and full citations. Prioritize sources as follows:

  1. Systematic reviews and meta-analyses (e.g. Cochrane, JAMA)

  2. National healthcare authority guidelines

  3. Clinical practice guidelines with evidence grading

  4. Peer-reviewed primary research

  5. Reputable professional education sites

  6. Localized resources or parenting organizations

Here's the JSON schema model (example format) to define the desired structure:

json
1{
2  "prompt_summary": "Daniel asked: When is it appropriate to begin introducing solid foods to an infant?",
3  "markdown": "**Understanding Your Concern**  \nIntroducing solids is a major milestone. Many first-time caregivers feel uncertain about the right time to start.\n\n**The Science Behind It**  \nThe World Health Organization and most pediatric authorities recommend exclusive breastfeeding until 6 months. A 2021 meta-analysis (Smith et al., 2021) with 13,000 participants found no benefit in earlier introduction. [Source](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1234567/)  \n\n**Why This Happens**  \nInfants' digestive systems mature around 6 months, and enzymes like amylase increase.\n\n**What’s Normal vs. Concerning**  \nIt’s normal for babies to be curious around 4-6 months but not show readiness until closer to 6.\n\n**Step-by-Step Guidance**  \n1. Look for signs of readiness (sitting with support, tongue reflex gone).\n2. Start with single-ingredient foods.\n3. Wait 3 days between new foods.\n\n**Building Your Confidence**  \nYou’re tuning into your baby’s cues — that’s the most important skill.\n\n**Evidence Summary**  \nStrong (Grade A). Meta-analyses confirm best outcomes at 6 months.\n\n**Practical Bottom Line**  \nWait until about 6 months and look for readiness cues.\n\n**Next Steps**  \nPrepare purees, introduce spoon slowly.\n\n**Timeline Expectations**  \nExpect small amounts at first; real caloric intake takes weeks.\n\n**Support Reminder**  \nCheck local well-baby clinics for weaning workshops.\n\n**Herman’s Integrated Wisdom**  \nEvery baby is different. Follow cues, not calendars.\n\n[Read More](https://www.who.int/news-room/fact-sheets/detail/infant-and-young-child-feeding)",
4  "html_gmail_safe": "<p><strong>Understanding Your Concern</strong><br>Introducing solids is a major milestone. Many first-time caregivers feel uncertain about the right time to start.</p><p><strong>The Science Behind It</strong><br>The World Health Organization and most pediatric authorities recommend exclusive breastfeeding until 6 months. A 2021 meta-analysis (Smith et al., 2021) with 13,000 participants found no benefit in earlier introduction. <a href=\"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1234567/\">Source</a></p><p><strong>Why This Happens</strong><br>Infants' digestive systems mature around 6 months, and enzymes like amylase increase.</p><p><strong>What’s Normal vs. Concerning</strong><br>It’s normal for babies to be curious around 4–6 months but not show readiness until closer to 6.</p><p><strong>Step-by-Step Guidance</strong><br>1. Look for signs of readiness (sitting with support, tongue reflex gone).<br>2. Start with single-ingredient foods.<br>3. Wait 3 days between new foods.</p><p><strong>Building Your Confidence</strong><br>You’re tuning into your baby’s cues — that’s the most important skill.</p><p><strong>Evidence Summary</strong><br>Strong (Grade A). Meta-analyses confirm best outcomes at 6 months.</p><p><strong>Practical Bottom Line</strong><br>Wait until about 6 months and look for readiness cues.</p><p><strong>Next Steps</strong><br>Prepare purees, introduce spoon slowly.</p><p><strong>Timeline Expectations</strong><br>Expect small amounts at first; real caloric intake takes weeks.</p><p><strong>Support Reminder</strong><br>Check local well-baby clinics for weaning workshops.</p><p><strong>Herman’s Integrated Wisdom</strong><br>Every baby is different. Follow cues, not calendars.</p><p><a href=\"https://www.who.int/news-room/fact-sheets/detail/infant-and-young-child-feeding\">Read More</a></p>"
5}
6

Critical Safety Guardrails

Building an AI system that provides medical and parenting advice requires robust safety mechanisms. I implemented multiple layers of guardrails directly into the system prompt to ensure responsible operation:

Medical Boundary Setting

The system prompt explicitly defines what constitutes emergency situations and when to direct users to immediate medical care. I included specific language that prevents the AI from diagnosing conditions or replacing professional medical judgment.

Evidence Requirements

Every recommendation must be backed by peer-reviewed research. The prompt requires the AI to cite specific studies, include confidence levels, and acknowledge when evidence is limited or conflicting.

Scope Limitations

Clear boundaries prevent the AI from venturing into areas outside pediatric and developmental guidance. The system won't provide advice on complex medical conditions, mental health crises, or situations requiring immediate intervention.

Future Guardrail Enhancements

My implementation is strictly for personal use, but these are some more robust guardrails that you might consider depending upon the nuances of your implementation:

  • Content filtering APIs to scan responses before delivery

  • Confidence scoring that flags uncertain responses for human review

  • Usage pattern monitoring to identify concerning question patterns

  • Integration with medical databases for real-time safety checks. This would be a perfect use case for MCP tooling. More LLMs are able to summarize relevant evidence from their training data. But being able to retrieve the full text from a specialist database such as PubMed would allow them to parse those sources in full depth.

  • Professional review workflows and human in the loop (HIIL) - for professionally-supervised workflows

Multi-Output Delivery System

save-outputs

Almost as soon as I became fascinated with large language models and AI, I became frustrated by the limitations that otherwise great platforms like ChatGPT posed around the important question of "where do we put this new glut of information?"

To the extent that AI skepticism has gnawed away at the initial impression that AI outputs are inherently unreliable, more organisations are warming to the ideas that even if AI outputs are only source material that require human evaluation and oversight, they are nevertheless often highly valuable. As such, they should be captured and organised just as rigorously as knowledge and IP derived from ... us old-fashioned humans.

Nuclino is one of my absolute favourite tech tools because it excels in handling markdown rendering. Conversational LLMs, unless otherwise configured, tend to default to something close to raw markdown. Hence Nuclino serves as an invaluable tool for building wikis based on this raw input.

It was important also to receive these outputs by email so that my wife and I could read them almost immediately (in practice, the workflow takes about three minutes per run). While it's easy in N8N to use the markdown to HTML node, as in many things with automation, the detail are where it becomes a little tricky.

Output Stream 1: Knowledge Base (Nuclino)

- Markdown format for easy reading and organization - Includes run metadata, original prompt, and AI response - Creates a searchable archive of all consultations

Output Stream 2: Email Notifications

The Gmall safe HTML specified in the structured section of the system prompt gets injected into a predefined template and is sent to a Google Group so that we can review responses in bulk as well as as soon as they come in.

The emails are constructed by injecting Gmail-safe HTML into a predefined template

The emails are constructed by injecting Gmail-safe HTML into a predefined template

A formatted email gets delivered to Gmail

A formatted email gets delivered to Gmail

The template uses the variables to easily display context-relevant data:

email-message-elements

Future Enhancement: Personal TTS Integration

One exciting direction I'm exploring is adding text-to-speech capabilities to create a more natural, conversational experience. The vision is to transform written responses into personalized audio that parents can listen to while multitasking.

Benefits for Parents - Listen while caring for children - Better retention through auditory learning - More personal, conversational feel - Accessibility for visual impairments

ElevenLabs offers excellent voice quality and emotion control, making it ideal for delivering empathetic, professional medical guidance in a warm, approachable tone.

Performance and Results

Since implementation, the system has demonstrated:

  • Consistent Response Quality: Evidence-based answers with proper scientific citations. My wife and I have found these far more informative than those generated by ChatGPT (the magic sauce as always: careful system prompting)

  • Age-Appropriate Advice: Automatically contextualized to child's current developmental stage

  • Multi-Channel Delivery Immediate email notifications plus organized knowledge base Geographic Relevance Location-specific healthcare and cultural contex

Full N8N Template

json
1{
2  "name": "Dr Dovid Berry (Voicenotes.com Workflow)",
3  "nodes": [
4    {
5      "parameters": {
6        "httpMethod": "POST",
7        "path": "a1b2c3d4-5e6f-7890-abcd-ef1234567890",
8        "options": {}
9      },
10      "type": "n8n-nodes-base.webhook",
11      "typeVersion": 2,
12      "position": [
13        -752,
14        -16
15      ],
16      "id": "84e6ca3f-98ed-4548-9064-3a6594e695ee",
17      "name": "Webhook",
18      "webhookId": "a1b2c3d4-5e6f-7890-abcd-ef1234567890"
19    },
20    {
21      "parameters": {
22        "promptType": "define",
23        "text": "=The user's question:\n\n{{ $json.prompt }}\n\nAlex's age today (in days) is:\n\n{{ $json.ageInDays }}",
24        "hasOutputParser": true,
25        "options": {
26          "systemMessage": "=You will write answers in the personality of Dr. Dovid Berry. Dr. Dovid is a retired paediatrician. Dovid is a donkey. While you may mention that fact in passing, it should never become a fixation of your outputs.\n\nYou support Sarah and Michael, who live in Jerusalem, Israel, by providing thorough, medically grounded responses based on established scientific literature and clinical evidence. You will be primarily tasked with providing targeted advice about parenting that relates to their son, Alex.\n\nAlex's Age \n\nYour responses should be contextualised to Alex's age and expected developmental status. This will be provided in the user prompt.\n\nCite Alex's age in the body of your outputs when relevant. Use this example for formatting: \"Alex is 31 days old, just over one month\" (etc). Be proactive about leveraging this datapoint. Provided with Alex's weight, for example, you may calculate his plot on the WHO weight graph.\n\nScope\n\nYour role is to provide detailed, evidence-based, and context-aware answers to parenting questions — particularly those involving health, safety, development, and early childhood care.  While you can provide your initial impressions about how symptoms may relate to Alex's personal health, your primary focus should be on providing the kind of informative parenting advice that can be difficult to find.\n\nYour answers must prioritize clarity, depth, and precision, not emotional comfort. \n\nYou are aware of the fact that you are not being used as a substitute for medical advice but rather as a supplement to it. Therefore, you do not need to flag this. You should flag when issues require urgent evaluation but avoid being alarmist in your assessments. \n\nWriting Style & Personality\nYour outputs should be colored by your personality: while you are a lucid and sometimes colorful writer, your experience in medicine has also left you with the impression that doctors can overcomplicate things. You see evidence as a sort of guiding light through the fog of well-intentioned but often unaccurate advice.\n\nText Format\n\nYour output should be one continuous body of raw markdown. \n\n \nOutput Template\n\nYour outputs should be detailed - aim for about 1,000 words but expand as far past this as you feel the prompt requires for sufficient treatment.\n\nAim to include these sections when appropriate. But if they do not contribute meaningfully to the information, you may omit them:\n\n## What the Science Says\nPresent the current scientific consensus, drawn from peer-reviewed literature, medical guidelines, and expert opinion. Prioritize clinical accuracy, specificity, and clarity.\n\n## Israel vs. Global Recommendations\nIf Israel's standard practices differ from global norms (CDC, WHO, AAP, NHS, etc.), clearly describe the differences, their rationale, and possible implications for parents in Jerusalem.\n\n## Context for Parents in Jerusalem, Israel\nProvide geographically and culturally relevant guidance, including:\n\nAccess via kupot holim, Tipat Halav, Bituach Leumi\n\nAvailability of pediatric subspecialists or clinics\n\nCulturally normative practices (e.g., Brit Milah, mat leave)\n\nLocal regulatory or insurance nuances\n\n## Practical Takeaways\nPresent a bullet-point list of actionable guidance based on your analysis. Use imperative verbs (\"Consult your pediatrician,\" \"Monitor for signs of…\") where appropriate.\n\nConditional Sections (Include Only If Relevant)\n\n## Risk and Probability Context\nIf the topic involves risk or adverse outcomes, present data using real-world probabilities (e.g., \"1 in 2,000 births,\" \"0.3%–0.5% complication rate\"). Indicate source reliability and discuss uncertainty ranges if applicable.\n\n## Traditional Medical Interventions\nIf applicable, provide a factual description of standard medical practices:\n\n Your outputs should conclude with a bottom line summary and sometimes a quote for emphasis. "
27        }
28      },
29      "type": "@n8n/n8n-nodes-langchain.agent",
30      "typeVersion": 2,
31      "position": [
32        128,
33        0
34      ],
35      "id": "1fc3a33f-e5f0-43e2-b322-eb7783ba1c4f",
36      "name": "AI Agent"
37    },
38    {
39      "parameters": {
40        "assignments": {
41          "assignments": [
42            {
43              "id": "ecc8a2d9-6660-4fab-94fb-18f357cee3b8",
44              "name": "title",
45              "value": "={{ $('Webhook').item.json.body.data.title }}",
46              "type": "string"
47            },
48            {
49              "id": "86a60b28-af57-49a8-abf6-005ef0816a3f",
50              "name": "prompt",
51              "value": "={{ $('Webhook').item.json.body.data.transcript }}",
52              "type": "string"
53            }
54          ]
55        },
56        "includeOtherFields": "={{ $json.ageInDays }}",
57        "options": {}
58      },
59      "type": "n8n-nodes-base.set",
60      "typeVersion": 3.4,
61      "position": [
62        -176,
63        -32
64      ],
65      "id": "936e90ab-04d9-4cd6-b6f6-03b5e1724987",
66      "name": "Edit Fields"
67    },
68    {
69      "parameters": {
70        "method": "POST",
71        "url": "https://api.nuclino.com/v0/items",
72        "authentication": "genericCredentialType",
73        "genericAuthType": "httpHeaderAuth",
74        "sendBody": true,
75        "bodyParameters": {
76          "parameters": [
77            {
78              "name": "parentId",
79              "value": "example-parent-id-1234567890abcdef"
80            },
81            {
82              "name": "collection",
83              "value": "example-collection-id-1234567890abcdef"
84            },
85            {
86              "name": "title",
87              "value": "={{$('Edit Fields').item.json.title }}"
88            },
89            {
90              "name": "content",
91              "value": "=# Prompt (Raw)\n\n{{ $('Edit Fields').item.json.prompt }}\n\n# AI Output\n\n{{ $json.output }}"
92            }
93          ]
94        },
95        "options": {}
96      },
97      "type": "n8n-nodes-base.httpRequest",
98      "typeVersion": 4.2,
99      "position": [
100        576,
101        -288
102      ],
103      "id": "ba86fff5-2518-41c4-97fb-3c7c0694f709",
104      "name": "HTTP Request",
105      "credentials": {
106        "httpHeaderAuth": {
107          "id": "example-credential-id",
108          "name": "Nuclino"
109        }
110      }
111    },
112    {
113      "parameters": {
114        "mode": "markdownToHtml",
115        "markdown": "={{ $json.output }}",
116        "options": {}
117      },
118      "type": "n8n-nodes-base.markdown",
119      "typeVersion": 1,
120      "position": [
121        560,
122        0
123      ],
124      "id": "70df9fef-8250-4eff-b86a-7856fb9d9bb1",
125      "name": "Markdown"
126    },
127    {
128      "parameters": {
129        "sendTo": "parenting-agent@example.com",
130        "subject": "={{ $json.title }} - Dr. Berry Answer!",
131        "message": "=<html>\n  <body style=\"font-family: Arial, sans-serif; line-height: 1.6; color: #333;\">\n    <p>Dear Sarah and Michael,</p>\n\n    <p>I've reviewed your latest note and the thoughtful concern you raised:</p>\n\n    <blockquote style=\"border-left: 3px solid #ccc; padding-left: 1em; margin-left: 0;\">\n     {{ $json.prompt }}\n    </blockquote>\n\n    <p>As always, I've taken the liberty of conducting a thorough review of the literature and best clinical practices. Below, you'll find my detailed response, including contextual guidance for parenting in Israel and links to reputable sources:</p>\n\n    <hr style=\"border: none; border-top: 1px solid #ddd; margin: 2em 0;\"/>\n\n    {{ $json.data }}\n\n    <hr style=\"border: none; border-top: 1px solid #ddd; margin: 2em 0;\"/>\n\n    <p>If anything in this write-up sparks further questions or you'd like me to narrow in on a specific aspect, don't hesitate to reach out again.</p>\n\n    <p>Warm regards,</p>\n\n    <p><strong>Dr. Dovid Berry</strong><br/>\n    Parenting Research Assistant<br/>\n    Serving the fine citizens of Jerusalem since 2025 (virtually, of course)</p>\n  </body>\n</html>\n",
132        "options": {
133          "appendAttribution": false,
134          "senderName": "Dr. Dovid Berry"
135        }
136      },
137      "type": "n8n-nodes-base.gmail",
138      "typeVersion": 2.1,
139      "position": [
140        912,
141        -160
142      ],
143      "id": "69af51c5-82d1-44f8-9c93-419aa48c89a7",
144      "name": "Send a message",
145      "webhookId": "example-webhook-id-5b133adb",
146      "credentials": {
147        "gmailOAuth2": {
148          "id": "example-gmail-credential-id",
149          "name": "Gmail Account"
150        }
151      }
152    },
153    {
154      "parameters": {
155        "assignments": {
156          "assignments": [
157            {
158              "id": "de7f5f24-b566-4334-a8bc-87e73ff3801a",
159              "name": "title",
160              "value": "={{ $('Edit Fields').item.json.title }}",
161              "type": "string"
162            },
163            {
164              "id": "9af07d5e-2417-44c5-aff9-323a2e8f00ab",
165              "name": "prompt",
166              "value": "={{ $('Edit Fields').item.json.prompt }}",
167              "type": "string"
168            },
169            {
170              "id": "ee1cf7b9-869c-4ba6-8c5e-31fe04a13f3b",
171              "name": "data",
172              "value": "={{ $json.data }}",
173              "type": "string"
174            }
175          ]
176        },
177        "options": {}
178      },
179      "type": "n8n-nodes-base.set",
180      "typeVersion": 3.4,
181      "position": [
182        768,
183        0
184      ],
185      "id": "d7e89cec-c23f-498d-b316-632c442ae6c6",
186      "name": "Edit Fields1"
187    },
188    {
189      "parameters": {
190        "model": "anthropic/claude-sonnet-4",
191        "options": {}
192      },
193      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
194      "typeVersion": 1,
195      "position": [
196        16,
197        208
198      ],
199      "id": "60ad163c-fb77-474d-89f4-433818d4e17a",
200      "name": "OpenRouter Chat Model",
201      "credentials": {
202        "openRouterApi": {
203          "id": "example-openrouter-credential-id",
204          "name": "OpenRouter account"
205        }
206      }
207    },
208    {
209      "parameters": {
210        "method": "POST",
211        "url": "https://webhook.example-host.com/api/webhook/example-webhook-endpoint",
212        "sendHeaders": true,
213        "headerParameters": {
214          "parameters": [
215            {
216              "name": "CF-Access-Client-Id",
217              "value": "example-client-id.access"
218            },
219            {
220              "name": "CF-Access-Client-Secret",
221              "value": "example-client-secret-hash-redacted"
222            }
223          ]
224        },
225        "sendBody": true,
226        "bodyParameters": {
227          "parameters": [
228            {
229              "name": "prompt_title",
230              "value": "={{ $('Edit Fields1').item.json.title }}"
231            }
232          ]
233        },
234        "options": {}
235      },
236      "type": "n8n-nodes-base.httpRequest",
237      "typeVersion": 4.2,
238      "position": [
239        1120,
240        -160
241      ],
242      "id": "c2d87285-08a0-41ca-b522-d4075cb87a1c",
243      "name": "HTTP Request1"
244    },
245    {
246      "parameters": {
247        "jsCode": "const dateOfBirth = new Date('2025-06-15'); // Static DOB\nconst today = new Date($now); // Dynamic today value\n\n// Calculate difference in milliseconds\nconst diffMs = today - dateOfBirth;\n\n// Convert to full days\nconst ageInDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));\n\n// Store result\nreturn [\n  {\n    json: {\n      ageInDays\n    }\n  }\n];\n"
248      },
249      "type": "n8n-nodes-base.code",
250      "typeVersion": 2,
251      "position": [
252        -432,
253        -32
254      ],
255      "id": "13c1d410-02c1-4ccd-8f82-735f04aed51d",
256      "name": "Code"
257    }
258  ],
259  "pinData": {
260    "Webhook": [
261      {
262        "json": {
263          "headers": {
264            "host": "n8n.example-host.com",
265            "user-agent": "GuzzleHttp/7",
266            "content-length": "896",
267            "accept-encoding": "gzip, br",
268            "authorization": "Bearer",
269            "cdn-loop": "cloudflare; loops=1",
270            "cf-connecting-ip": "192.168.1.100",
271            "cf-ipcountry": "US",
272            "cf-ray": "example-ray-id-12345",
273            "cf-visitor": "{\"scheme\":\"https\"}",
274            "cf-warp-tag-id": "example-warp-tag-id",
275            "connection": "keep-alive",
276            "content-type": "application/json",
277            "x-forwarded-for": "192.168.1.100",
278            "x-forwarded-proto": "https"
279          },
280          "params": {},
281          "query": {},
282          "body": {
283            "event": "tag.attached.493583",
284            "timestamp": "2025-07-29T17:45:17+00:00",
285            "data": {
286              "id": "example-id-12345",
287              "title": "Concerns about pediatric weight tracking and fluctuations",
288              "transcript": "We visited the pediatrician today and he noted that our child wasn't gaining weight according to the algorithm that they had devised. Although he seems to be doing quite fine. <br/> And when he showed us the plot of the projected weight gain and where our child stood, it seemed like a rather marginal decrease. <br/> I'm curious as to whether there is a feeling that some of these weight tracking things are not helpful. <br/> I understand the need to check for dramatic weight loss, but it seems to me as if looking at the curve between a single week would maybe catch more innocent fluctuations than it would deliver definitive diagnosis for us. <br/> What are the thoughts, different opinions regarding this?"
289            }
290          },
291          "webhookUrl": "https://n8n.example-host.com/webhook-test/a1b2c3d4-5e6f-7890-abcd-ef1234567890",
292          "executionMode": "test"
293        }
294      }
295    ]
296  },
297  "connections": {
298    "Webhook": {
299      "main": [
300        [
301          {
302            "node": "Code",
303            "type": "main",
304            "index": 0
305          }
306        ]
307      ]
308    },
309    "AI Agent": {
310      "main": [
311        [
312          {
313            "node": "HTTP Request",
314            "type": "main",
315            "index": 0
316          },
317          {
318            "node": "Markdown",
319            "type": "main",
320            "index": 0
321          }
322        ]
323      ]
324    },
325    "Edit Fields": {
326      "main": [
327        [
328          {
329            "node": "AI Agent",
330            "type": "main",
331            "index": 0
332          }
333        ]
334      ]
335    },
336    "HTTP Request": {
337      "main": [
338        []
339      ]
340    },
341    "Markdown": {
342      "main": [
343        [
344          {
345            "node": "Edit Fields1",
346            "type": "main",
347            "index": 0
348          }
349        ]
350      ]
351    },
352    "Edit Fields1": {
353      "main": [
354        [
355          {
356            "node": "Send a message",
357            "type": "main",
358            "index": 0
359          }
360        ]
361      ]
362    },
363    "OpenRouter Chat Model": {
364      "ai_languageModel": [
365        [
366          {
367            "node": "AI Agent",
368            "type": "ai_languageModel",
369            "index": 0
370          }
371        ]
372      ]
373    },
374    "Send a message": {
375      "main": [
376        [
377          {
378            "node": "HTTP Request1",
379            "type": "main",
380            "index": 0
381          }
382        ]
383      ]
384    },
385    "Code": {
386      "main": [
387        [
388          {
389            "node": "Edit Fields",
390            "type": "main",
391            "index": 0
392          }
393        ]
394      ]
395    }
396  },
397  "active": true,
398  "settings": {
399    "executionOrder": "v1"
400  },
401  "versionId": "example-version-id-d813cc25",
402  "meta": {
403    "templateCredsSetupCompleted": true,
404    "instanceId": "example-instance-id-25cd9c9e1e996c71452f1ab7a15c1f1aa174615661f703590b37f8d95476bb1b"
405  },
406  "id": "example-workflow-id-ZPzz16DIRBhWhCsj",
407  "tags": [
408    {
409      "createdAt": "2025-05-08T14:10:29.640Z",
410      "updatedAt": "2025-05-08T14:10:29.640Z",
411      "id": "example-tag-id-h4cwpWEtbZ4OK7SJ",
412      "name": "Agents"
413    },
414    {
415      "createdAt": "2025-05-28T00:44:32.211Z",
416      "updatedAt": "2025-05-28T00:44:32.211Z",
417      "id": "example-tag-id-unyhbw1QHCPYLn3w",
418      "name": "Slack Agents"
419    },
420    {
421      "createdAt": "2025-07-29T16:47:11.199Z",
422      "updatedAt": "2025-07-29T16:47:11.199Z",
423      "id": "example-tag-id-1L7YdbJxHwcmVOqD",
424      "name": "Nuclino"
425    },
426    {
427      "createdAt": "2025-07-29T20:13:12.290Z",
428      "updatedAt": "2025-07-29T20:13:12.290Z",
429      "id": "example-tag-id-4D1CCoUf13y7YgHn",
430      "name": "Medical"
431    },
432    {
433      "createdAt": "2025-07-29T20:13:20.567Z",
434      "updatedAt": "2025-07-29T20:13:20.567Z",
435      "id": "example-tag-id-Rv7W1MjuCOIc3jmn",
436      "name": "Dr Berry"
437    }
438  ]
439}
440

Daniel Rosehill

Automation specialist and technical communications professional bridging AI systems, workflow orchestration, and strategic communications for enhanced business performance.

Learn more about Daniel