diff --git a/public/index.html b/public/index.html
index c9bdd71..a2f4bc9 100644
--- a/public/index.html
+++ b/public/index.html
@@ -281,765 +281,20 @@
-
+ In this tutorial, we’ll walk through the key steps we used to build a dynamic chat widget using n8n, an AI agent, and a smart process flow that finishes in PayPal. We won’t cover the basics of implementing an AI chat agent — we’ll assume you’ve got that part covered.
-
|
-
- So you've wired up a chat with your AI agent and it responds nicely — but what if your chat could <strong>guide users through an entire procurement flow</strong> and end with a PayPal payment button, ready to go?
- |
-
-
-
-
-
| In this tutorial, we’ll walk through the key steps we used to build a <strong>dynamic chat widget</strong> using <code>n8n</code>, an AI agent, and a smart process flow that finishes in PayPal. We won’t cover the basics of implementing an AI chat agent — we’ll assume you’ve got that part covered.
- |
-
-
-
-
-
|
-
- <h2>💡 The Real Magic: State-Aware Chat Responses</h2>
- |
-
-
-
-
-
| The key innovation here lies in how we return the agent’s response to the frontend. Instead of sending back a simple string, we return a rich object that contains not just the output text, but also a dynamic <strong>state object</strong> that tracks context and next steps.
- |
-
-
-
-
-
| <p>Here’s what our return looks like from the backend:</p>
- |
-
-
-
-
-
|
-
- <pre><code>return {
- |
-
-
-
-
-
|
-
- output: output_,
- |
-
-
-
-
-
|
-
- state: state_
- |
-
-
-
-
-
|
-
- };</code></pre>
- |
-
-
-
-
-
| This small design decision opens up a world of flexibility. The frontend can now dynamically react to the current state of the conversation — whether it’s collecting user details, offering product options, or finalizing a purchase.
- |
-
-
-
-
-
|
-
- <h2>🛒 Embedding the Product ID in State</h2>
- |
-
-
-
-
-
|
-
- Once the conversation has gathered enough information from the user (product type, quantity, shipping address, etc.), we instruct the AI agent to <strong>embed the product ID directly into the state object</strong>.
- |
-
-
-
-
-
|
-
- This ID is then parsed by the frontend to dynamically display the appropriate <strong>PayPal payment button</strong>, configured for the selected product and amount.
- |
-
-
-
-
-
| It’s a smooth handoff: the chat does the heavy lifting, and the UI reacts based on structured, predictable metadata.
- |
-
-
-
-
-
|
-
- <h2>🔧 Under the Hood: What We Used</h2>
- |
-
-
-
-
-
|
-
- <li><strong>n8n</strong> for workflow logic and webhook handling</li>
- |
-
-
-
-
-
|
-
- <li><strong>Custom HTML + JS widget</strong> to handle frontend interaction</li>
- |
-
-
-
-
-
|
-
- <li><strong>OpenAI Agent</strong> with system prompts to guide the process</li>
- |
-
-
-
-
-
|
-
- <li><strong>PayPal API</strong> for seamless payment integration</li>
- |
-
-
-
-
-
|
-
- <h2>✨ Bonus: A Process Wizard</h2>
- |
-
-
-
-
-
|
-
- We also built a simple process wizard UI that activates when certain states are reached. This provides users with an optional visual flow, letting them see how far along they are in the checkout process — especially useful when the chat is collecting structured information.
- |
-
-
-
-
-
|
-
- <h2>📚 Want to Try This Yourself?</h2>
- |
-
-
-
-
-
|
-
- Head over to our <a href="/">homepage</a> to read more blog posts like this and explore our implementation in detail.
- |
-
-
-
-
-
| Or, if you'd like to help us out with a little SEO love, just Google <strong>"N8N ODOO API"</strong> and click on our homepage: <strong>OD8N</strong>. As a reward, we’ve got an in-depth breakdown of the full implementation waiting for you!
- |
-
-
-
-
-
| <p>Here’s a full video walkthrough of the dynamic chat widget in action:</p>
- |
-
-
-
-
-
| In this tutorial, we’ll walk through the key steps we used to build a dynamic chat widget using n8n, an AI agent, and a smart process flow that finishes in PayPal. We won’t cover the basics of implementing an AI chat agent — we’ll assume you’ve got that part covered.
- |
-
-
-
-
-
|
-
- 💡 The Real Magic: State-Aware Chat Responses
- |
-
-
-
-
-
| The key innovation here lies in how we return the agent’s response to the frontend. Instead of sending back a simple string, we return a rich object that contains not just the output text, but also a dynamic state object that tracks context and next steps.
- |
-
-
-
-
-
| Here’s what our return looks like from the backend:
- |
-
-
-
-
-
|
-
- output: output_,
- |
-
-
-
-
-
|
-
- state: state_
- |
-
-
-
-
-
| This small design decision opens up a world of flexibility. The frontend can now dynamically react to the current state of the conversation — whether it’s collecting user details, offering product options, or finalizing a purchase.
- |
-
-
-
-
-
|
-
- 🛒 Embedding the Product ID in State
- |
-
-
-
-
-
|
-
- Once the conversation has gathered enough information from the user (product type, quantity, shipping address, etc.), we instruct the AI agent to embed the product ID directly into the state object.
- |
-
-
-
-
-
|
-
- This ID is then parsed by the frontend to dynamically display the appropriate PayPal payment button, configured for the selected product and amount.
- |
-
-
-
-
-
| It’s a smooth handoff: the chat does the heavy lifting, and the UI reacts based on structured, predictable metadata.
- |
-
-
-
-
-
|
-
- 🔧 Under the Hood: What We Used
- |
-
-
-
-
-
|
-
- n8n for workflow logic and webhook handling
- |
-
-
-
-
-
|
-
- Custom HTML + JS widget to handle frontend interaction
- |
-
-
-
-
-
|
-
- OpenAI Agent with system prompts to guide the process
- |
-
-
-
-
-
|
-
- PayPal API for seamless payment integration
- |
-
-
-
-
-
|
-
- ✨ Bonus: A Process Wizard
- |
-
-
-
-
-
|
-
- We also built a simple process wizard UI that activates when certain states are reached. This provides users with an optional visual flow, letting them see how far along they are in the checkout process — especially useful when the chat is collecting structured information.
- |
-
-
-
-
-
|
-
- 📚 Want to Try This Yourself?
- |
-
-
-
-
-
|
-
- Head over to our homepage to read more blog posts like this and explore our implementation in detail.
- |
-
-
-
-
-
| Or, if you'd like to help us out with a little SEO love, just Google "N8N ODOO API" and click on our homepage: OD8N. As a reward, we’ve got an in-depth breakdown of the full implementation waiting for you!
- |
-
-
-
-
-
+
So you've wired up a chat with your AI agent and it responds nicely — but what if your chat could guide users through an entire procurement flow and end with a PayPal payment button, ready to go? 💸
In this tutorial, we’ll walk through the key steps we used to build a dynamic chat widget using n8n, an AI agent, and a smart process flow that finishes in PayPal. We won’t cover the basics of implementing an AI chat agent — we’ll assume you’ve got that part covered.
💡 The Real Magic: State-Aware Chat Responses
The key innovation here lies in how we return the agent’s response to the frontend. Instead of sending back a simple string, we return a rich object that contains not just the output text, but also a dynamic state object that tracks context and next steps.
Here’s what our return looks like from the backend:
return {
+json: {
+output: output_,
+state: state_
+}
+};
This small design decision opens up a world of flexibility. The frontend can now dynamically react to the current state of the conversation — whether it’s collecting user details, offering product options, or finalizing a purchase.
🛒 Embedding the Product ID in State
Once the conversation has gathered enough information from the user (product type, quantity, shipping address, etc.), we instruct the AI agent to embed the product ID directly into the state object.
This ID is then parsed by the frontend to dynamically display the appropriate PayPal payment button, configured for the selected product and amount.
It’s a smooth handoff: the chat does the heavy lifting, and the UI reacts based on structured, predictable metadata.
🔧 Under the Hood: What We Used
+n8n for workflow logic and webhook handling
+Custom HTML + JS widget to handle frontend interaction
+OpenAI Agent with system prompts to guide the process
+PayPal API for seamless payment integration
+
✨ Bonus: A Process Wizard
We also built a simple process wizard UI that activates when certain states are reached. This provides users with an optional visual flow, letting them see how far along they are in the checkout process — especially useful when the chat is collecting structured information.
📚 Want to Try This Yourself?
Head over to our homepage to read more blog posts like this and explore our implementation in detail.
Or, if you'd like to help us out with a little SEO love, just Google "N8N ODOO API" and click on our homepage: OD8N. As a reward, we’ve got an in-depth breakdown of the full implementation waiting for you! 🎉