Skip to main content

Build a personalized birthday AI companion with GPT-4 and PostgreSQL

Workflow preview

Workflow preview
100%
Build a personalized birthday AI companion with GPT-4 and PostgreSQL preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Idea The idea for app came since I wanted to build a unique gift for my niece because she gets excited for her birthday (which Im going to miss this year). The web app has a simple countdown (in ht...

Best for

  • Personal Productivity automation workflows
  • AI Chatbot automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.respondtowebhook, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.postgres, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.memorybufferwindow

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Praveena.

Original n8n.io source

1.1 Workflow description

Title
Build a personalized birthday AI companion with GPT-4 and PostgreSQL
Workflow name
Build a personalized birthday AI companion with GPT-4 and PostgreSQL

Idea

The idea for app came since I wanted to build a unique gift for my niece because she gets excited for her birthday (which Im going to miss this year). The web app has a simple countdown (in html and JS) but more importantly, there is an AI agent that will answer some specific questions and know her preferences.

How it works

The questions from app are sent via web hook to N8N which has pulls preferences file (about her likes, dislikes, personality) from postgre and AI Agent that will answer questions/respond. The current status is stored back in postgre (especially about status of cat and universe happenings) before responding back.

Features

  • Integrated AI chatbot via N8N webhook
  • Persistent conversation history
  • Minimizable chat interface
  • Fallback support for offline testing
  • Features: -- Wheres Mittens - This is a query to track her lost cat in multiverse. -- Multiverse updates with recent update stored

Pre Requisites

  • Postgre SQL database is available. Alternatively, use any other database but change the N8N nodes.
  • LLM Api Key.

Step by Step Instructions

  1. Export this N8N Workflow.
  2. Modify LLM API Key, I used openAI, 4.1
  3. For web app scofflding,you will need Node, HTML and Javascript. I've created a mini version using Node and JS with web app and N8N connection settings here: <https://github.com/productiser/FiBirthdayAgent>
  4. PostgreSQL Database Script (1 table for memory and context storage):
CREATE TABLE fifi_world_context (
    id TEXT PRIMARY KEY, -- e.g., 'agent_fifi'
    
    cat_location TEXT,        -- e.g., "Bubble Nebula"
    cat_activity TEXT,        -- e.g., "Playing laser tag with moon mice"

    fifi_preferences JSONB,   -- e.g., likes/dislikes/foods/shows
    world_history TEXT,       -- Summary of narrative events

    last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

5.Modify system prompt as per your needs.

Built With

N8N Self hosted Self hosted web app Hosted on Vercel Total spend = <£1 (AI costs only) Total Time = <1 day

Support

Watch this video for web app overview and how it looks. <https://youtu.be/e7PlrTdvwoM>

Contact me on [email protected]/ [email protected] for any queries

Hope you enjoy!!

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 2 - Respond to Webhook

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.2

Block 3 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.9

Block 4 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 5 - Postgres

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 6 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - Postgres1

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 8 - Code1

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - Simple Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

3. Summary Table

Workflow Build a personalized birthday AI companion with GPT-4 and PostgreSQL
Complexity intermediate
Nodes 9
Categories Personal Productivity, AI Chatbot
Author Praveena
Published 06 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5721/5721.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Build a personalized birthday AI companion with GPT-4 and PostgreSQL do?

Idea The idea for app came since I wanted to build a unique gift for my niece because she gets excited for her birthday (which Im going to miss this year). The web app has a simple countdown (in ht...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Personal Productivity, AI Chatbot use case.