Generate Square invoices and subscriptions from text with GPT-4o Mini
Ready for 3.0What this workflow does
This AI workflow has 25 nodes and runs when another workflow calls it. Along the way it connects OpenAI Chat Model. It also calls connect.squareup.com over HTTP.
How it runs
Trigger: When another workflow calls it.
- 2. Structure Invoice Data (AI Agent): runs an AI agent, with model: OpenAI Model - Agent; output parser: Structured Output Parser
- 3. Map Invoice Fields (Edit Fields (Set)): sets 10 fields: Name, Email, Amount…
- 4. Search Customer (HTTP Request): calls connect.squareup.com (POST)
- 5. Customer Exists? (If): checks a condition and branches into true / false
- 6a. Use Existing Customer (Edit Fields (Set)): sets 2 fields: customer, invoiceData
- 6b. Create Customer (HTTP Request): calls connect.squareup.com (POST)
- 7. Merge Customer Data (Edit Fields (Set)): sets 2 fields: customer, invoiceData
- 8. Get Customer Details (HTTP Request): calls an HTTP API
- 9. Check Card on File (Edit Fields (Set)): sets 2 fields: hasCard, cardCount
- 10. Card on File? (If): checks a condition and branches into true / false
…plus 11 more steps. See the full node list below.
Services it uses
HTTP calls to: connect.squareup.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (7)
- Edit Fields (Set)
n8n-nodes-base.set - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - AI Agent
@n8n/n8n-nodes-langchain.agent - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - HTTP Request
n8n-nodes-base.httpRequest - If
n8n-nodes-base.if - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger
From the author
Quick overview This sub-workflow accepts plain-language invoice details from a parent workflow, uses OpenAI to normalize and structure the data, then uses the Square API to find or create the customer, create and publish an invoice, and optionally create a…