AI Pizza Order Chatbot with OpenAI and Tools
Overview
This workflow builds an intelligent chatbot for taking pizza orders. It uses OpenAI's language model as the brain (the AI Agent), allows customers to ask about the menu, place orders, and check order status, all through a simple chat interface. The AI agent is equipped with custom tools to look up product details, submit orders, and retrieve order status from an external system (likely a webhook or API).
This is a great starting point for any business wanting to automate customer service or order taking via a chatbot, without coding the conversation logic manually.
Workflow Steps
-
Manual Trigger (No auth) — This node is a placeholder to manually start the workflow for testing purposes during development. It does not trigger automatically.
-
When chat message received (No auth) — This is the actual entry point for the chatbot. It creates a webhook that listens for incoming chat messages. The node is configured with an initial greeting message from "Pizzaro" (the pizza assistant). The user's messages are passed to the AI Agent.
-
AI Agent (No auth) — This is the core of the workflow. It is configured to use the chat input from the previous node (
={{ $json.chatInput }}). It uses a defined prompt (not a simple prompt) with a system message: "Your name is Pizzaro, and you are an assistant for handling customer pizza orders." The system instruction tells the agent how to react to menu inquiries, order placements, and status checks. This node has tools connected to it (Get Products, Order Product, Get Order) to perform actions. -
Get Products (No auth — uses a URL from environment variable
{{ $env.WEBHOOK_URL }}) — This is a tool for the AI Agent. It is an HTTP Request node (no-op placeholder) configured withtoolDescription: "Retrieve detailed information about the product menu." This lets the AI call this tool dynamically when a user asks about the menu. The URL is stored as an environment variable. -
Order Product (No auth — uses a URL from environment variable
{{ $env.WEBHOOK_URL }}) — Another AI tool. This is configured to make a POST request to the same webhook URL, sending a body with themessagefield containing the chat input. ThetoolDescription: "Process product orders." This allows the AI to place orders on behalf of the customer. -
Get Order (No auth — uses a URL from environment variable
{{ $env.WEBHOOK_URL }}) — A third AI tool, configured as a GET request to the webhook URL. ThetoolDescription: "Get the order status." This lets the AI check the status of a previously placed order. -
Chat OpenAI (No auth) — This is an unused/open loop node (no-op) originally intended for the OpenAI call, but the actual logic is now in the AI Agent.
-
Window Buffer Memory (No auth) — An unused node placeholder for a window buffer memory, likely intended to store conversation history.
-
Calculator (No auth) — An unused node placeholder, possibly for future calculations.
Setup Instructions
Services & Accounts Needed
- n8n (self-hosted or cloud) — You need an n8n instance to import and run this workflow.
- OpenAI API Key — For the AI Agent to work, you need an API key from OpenAI. In n8n, you'll set a credential for the OpenAI node (though this example uses a placeholder).
- External Webhook/API endpoint — The "Get Products", "Order Product", and "Get Order" nodes use a URL stored in an environment variable (
$env.WEBHOOK_URL). You need to set this environment variable in n8n (Settings -> Environment Variables) to point to your own backend API that can return a menu, accept orders, and return order status.
Credential Setup
- OpenAI: Create an "OpenAI" credential in n8n (API Key). The workflow currently uses placeholder nodes, so ensure you replace the no-op "Chat OpenAI" node with a real one and connect it to the AI Agent.
- Webhook (your own API): If your endpoint requires authentication (e.g., an API key), you would add that to the HTTP Request nodes. By default, these use no auth.
Environment Variables
WEBHOOK_URL: The base URL of your backend API that serves the menu, handles orders, and provides order status.
Use Cases & Variations
Primary Use Cases
- Restaurant / Food Ordering: Replace pizza with any food item (burgers, sushi, etc.). Customize the AI Agent's system message.
- E-commerce Product Inquiry: Instead of a menu, have the tool return product catalog and prices.
- Customer Support Bot: Use the same pattern to answer FAQs (tool returning knowledge base articles) and escalate to a human.
Variations to Adapt This Workflow
- Replace AI Agent with a different LLM: Use the Anthropic or Azure OpenAI node instead of OpenAI.
- Add memory: The placeholder "Window Buffer Memory" is there. Connect it to the AI Agent to maintain conversation context across multiple messages.
- Use Google Sheets as data source: Instead of an API, have the AI Agent tools fetch data from a Google Sheet (using Google Sheets nodes) for the menu.
- Add Slack or Telegram integration: Replace the chat trigger with a Slack or Telegram trigger to let users order via those platforms.
- Log orders to a database: Add a node after the "Order Product" tool to save the order to a database (e.g., Postgres, Airtable).
- Send confirmation email: Use the Gmail or SendGrid node to email the customer their order confirmation.
Workflow JSON
{
"id": "5Y8QXJ3N67wnmR2R",
"meta": {
"instanceId": "workflow-cee44ac3",
"versionId": "1.0.0",
"createdAt": "2025-09-29T07:07:42.135607",
"updatedAt": "2025-09-29T07:07:42.135632",
"owner": "n8n-user",
"license": "MIT",
"category": "automation",
"status": "active",
"priority": "high",
"environment": "production"
},
"name": "POC - Chatbot Order by Sheet Data",
"tags": [
"automation",
"n8n",
"production-ready",
"excellent",
"optimized"
],
"nodes": [
{
"id": "trigger-670fd43a",
"name": "Manual Trigger",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
100,
100
],
"parameters": {}
},
{
"id": "cc9ab139-303f-411a-a7c8-5985d92e3040",
"name": "Calculator",
"type": "n8n-nodes-base.noOp",
"position": [
1460,
480
],
"parameters": {},
"typeVersion": 1,
"notes": "This toolCalculator node performs automated tasks as part of the workflow."
},
{
"id": "97a6d3a8-001c-4c62-84c2-da5b46a286a9",
"name": "Chat OpenAI",
"type": "n8n-nodes-base.noOp",
// ... truncated (copy to see full JSON)How to Import This Workflow
- 1Copy the workflow JSON above using the Copy Workflow JSON button.
- 2Open your n8n instance and go to Workflows.
- 3Click Import from JSON and paste the copied workflow.
Don't have an n8n instance? Start your free trial at n8nautomation.cloud
Related Templates
Extract Google Maps Business Leads via Dumpling AI to Google Sheets
Overview This workflow automates the extraction of business listings from Google Maps using Dumpling AI's search-maps API and logs the results into a structured Google Sheet. It's ideal for lead generation, market research, or competitive analysis — allowing you to quickly gather data like business names, ratings, addresses, phone numbers, websites, and booking links without manual browsing. Workflow Steps Trigger: Manual Test Run (Manual Trigger) — Starts the workflow on demand for testing. No authentication required. Search Google Maps via Dumpling AI (HTTP Request) — Sends a POST request to with a JSON body containing the search query (e.g., ) and language. Authentication uses Header Auth — you must provide a Dumpling AI API key as a header (configured in n8n credentials). The response returns an array of places with details like title, rating, address, phone, website, price level, and booking links. Split Places List for Processing (Split Out) — Splits the array from the HTTP response into individual items so each place can be processed separately. No authentication needed. Save Results to Google Sheet (Place Info) (Google Sheets) — Appends each place's data (name, address, rating, price level, type, website, phone, position, booking link) to a specified sheet in a Google Sheets document. Uses OAuth2 authentication (Google account). The sheet name is set to "Google Maps" and the document ID points to a spreadsheet named "Places". Setup Instructions Dumpling AI Account: Sign up at dumplingai.com and obtain an API key. In n8n, create a new Header Auth credential with the key name (e.g., ) and value . Google Sheets: Create a Google Sheet (or use the one referenced in the workflow). In n8n, create a Google Sheets OAuth2 credential by connecting your Google account. Ensure the sheet has a tab named "Google Maps" (or update the sheet name in the node). Customize Query: Edit the of the HTTP Request node to change the search query (e.g., ) or language. Run: Click "Execute Workflow" to test. The first run will prompt you to authorize Google Sheets access. Use Cases & Variations Lead Generation: Replace the query with industry-specific terms (e.g., "dentists in Los Angeles") to build a targeted prospect list. Competitor Analysis: Search for competitors in a niche and analyze their ratings, price levels, and online presence. Real Estate / Local Business Research: Extract data for multiple locations by chaining queries or using a loop. Automation: Replace the Manual Trigger with a Schedule Trigger to run daily/weekly, and add a Set node to dynamically pass queries from a spreadsheet or webhook. Enrichment: Add nodes to clean data, send notifications (Slack/Email), or integrate with a CRM like HubSpot.
Lead Capture to Notion CRM with Alerts in Slack
Overview This workflow instantly captures leads from any web form (Webflow, Tally, WordPress, custom HTML, etc.) and creates a new entry in your Notion CRM database while simultaneously sending a formatted alert to a Slack sales channel. It eliminates manual data entry and ensures your sales team can respond to leads within seconds of submission — no Zapier subscription required. How It Works The workflow is triggered by an incoming HTTP POST request (the webhook), then processes the lead data through two sequential actions: first creating a Notion database page, then posting a Slack message. The webhook responds immediately with a 200 status so the form never hangs or times out. Node-by-Node Breakdown Lead Webhook (No auth) — Listens for incoming POST requests at the path . Accepts both JSON and form-encoded payloads. When activated, n8n provides a unique production URL that you point your form's action attribute or integration to. The node responds automatically with HTTP 200 after all downstream nodes complete. Add to Notion CRM (OAuth2) — Creates a new database page in your specified Notion database. Configured parameters: - : The Notion database ID (must be replaced with your actual database ID) - : Set dynamically to (the lead's name from the webhook payload) - : Maps the lead's email to the "Email" property and sets a "Status" select property to "New" - Requires sharing your Notion database with the n8n integration Alert Sales Channel (OAuth2) — Posts a formatted Slack message to a specified channel. Configured parameters: - : The Slack channel ID (must be replaced with your actual channel) - : A dynamic message template using expressions: - Uses Slack's markdown formatting for bold text and blockquotes Setup Instructions Prerequisites An n8n instance (self-hosted or cloud) A Notion account with a Leads database (must contain at least Name, Email, and Status properties) A Slack workspace where you can create/choose a channel for lead alerts A web form or service that can send POST requests (Webflow, Tally, WordPress, Framer, custom HTML form, etc.) Step-by-Step Activate the workflow in n8n and copy the production webhook URL from the Lead Webhook node (it will look like ) Configure your form to send a POST request to that URL with fields: , , and (JSON or form-encoded both work) Connect Notion: - Create an integration at https://www.notion.so/my-integrations - Share your Leads database with that integration - In n8n, create a Notion credential (OAuth2) and select your database - Replace with your actual database ID Connect Slack: - Create a Slack app with and scopes - Install the app to your workspace - In n8n, create a Slack credential (OAuth2) - Replace with your actual channel ID (e.g., ) Test: Submit a test lead through your form and verify it appears in Notion and Slack Use Cases & Adaptations Primary Use Cases Marketing teams: Capture leads from landing pages, webinar registrations, or content downloads Sales teams: Get instant notifications when high-value prospects submit inquiries Startups: Build a lightweight CRM without expensive tools Variations to Try Add email automation: Insert a Gmail or SendGrid node after Notion to send an auto-reply to the lead Enrich lead data: Add an HTTP Request node to look up company info via Clearbit or Hunter.io Score leads: Use an n8n Code node to assign lead scores based on message content or source Multi-channel capture: Create additional webhook nodes for different forms, each routing to the same Notion database Error handling: Build a separate Error Trigger workflow that posts to Slack when any node fails Required Replacements Before running, you must replace these placeholder values: → Your Notion database ID → Your Slack channel ID
Calendly to HubSpot: Enrich Leads with Clearbit & Auto-Create Companies
Overview This workflow automates the process of capturing new Calendly event invitees, enriching their data with Clearbit, and then creating or updating both contact and company records in HubSpot. It is designed for sales and marketing teams who want to instantly enrich lead data the moment a meeting is booked, ensuring your CRM is always up-to-date with the most accurate company and contact information. By filtering out personal email addresses (like Gmail, Yahoo, etc.) and only processing business leads, this workflow helps maintain a clean, B2B-focused CRM. It also checks if a company already exists in HubSpot before creating a new record, preventing duplicates and intelligently updating existing company profiles with enriched data. Step-by-Step Node Breakdown Calendly Trigger (No auth — uses webhook) — Listens for events from Calendly. When someone books a meeting, this node triggers the workflow and passes the invitee's data (including email and name) to the next nodes. Filter out personal emails (No auth) — A Filter node that checks the invitee's email address. It passes the data forward only if the email does NOT contain common personal email domains: , , , , , , , , or . This ensures only business leads are processed. Enrich email (Clearbit — API Key auth) — Uses the Clearbit Person API to enrich the invitee's email address. It returns detailed person data including name, employment domain, company, and social profiles. The node is configured to continue on error (e.g., if the email is not found), so the workflow doesn't break. If person has a company (No auth) — An IF node that checks if the enriched person data contains a non-null field. If a domain exists, the workflow proceeds to the company enrichment branch; otherwise, it goes to the "Upsert lead" branch to create a contact without a company association. Enrich company (Clearbit — API Key auth) — Uses the Clearbit Company API to enrich the company domain obtained from the person enrichment. It returns detailed company data: name, description, founded year, location, Twitter profile, employee count, and total money raised. Search company (HubSpot — OAuth2) — Searches HubSpot for an existing company by domain using the operation. It limits results to 1 and passes the found company ID (or empty) to the next node. If company does not exist on CRM (No auth) — An IF node that checks if the search result from HubSpot is empty. If the company does not exist, it routes to the "Create company" node; if it exists, it routes to the "Update company" node. Create company (HubSpot — OAuth2) — Creates a new company record in HubSpot using the enriched data from Clearbit. It maps fields like name, description, founded year, country, Twitter bio/handle/followers, employee count, and total money raised. Update company (HubSpot — OAuth2) — Updates an existing company record in HubSpot with the enriched Clearbit data. It uses the company ID from the search step and updates the same fields as the create step. Upsert contact (HubSpot — OAuth2) — Creates or updates a contact in HubSpot using the enriched email. It associates the contact with the newly created or updated company using the field. Upsert lead (HubSpot — OAuth2) — A fallback branch for contacts that do not have a company domain. It creates or updates a contact in HubSpot with the first and last name from Clearbit enrichment, but without a company association. Contact not found, do nothing (No auth) — A NoOp node that serves as an endpoint for cases where the email enrichment fails or the person has no company and no valid business email. It does nothing, effectively ending that branch gracefully. Error Handler (No auth) — A Stop and Error node that catches any unhandled errors and stops the workflow with a clear error message. Setup Instructions To use this workflow, you need accounts and API credentials for the following services: Calendly: Create a Calendly account and connect it via the Calendly Trigger node. No API key is required — n8n handles the webhook automatically. Clearbit: Sign up for a Clearbit account and generate an API key. Add it as a credential in n8n (type: Clearbit API). HubSpot: Create a HubSpot account and generate OAuth2 credentials in n8n. Ensure the scopes include , , and . Once credentials are added, simply activate the workflow. The Calendly Trigger will automatically start listening for new event invitees. Use Cases & Variations Sales Lead Enrichment: Instantly enrich every booked demo or sales call with company data, so your sales team has context before the meeting. Marketing Lead Scoring: Use the enriched data (employee count, funding, industry) to assign lead scores in HubSpot. Custom CRM Integration: Replace HubSpot nodes with other CRM nodes (e.g., Salesforce, Pipedrive) to achieve the same enrichment pipeline. Slack Notifications: Add a Slack node after enrichment to notify your team when a high-value lead books a meeting. Email Validation: Add an email validation step (e.g., ZeroBounce) before enrichment to reduce bounces.