Back to Blog
Automation Workflows

Lemon Squeezy to Loops: Add Buyers with n8n

n8n
n8n Resources Team
April 17, 2026

Ready to automate?

Browse 5,000+ copy-paste n8n workflow templates.

If you sell digital products or SaaS subscriptions through Lemon Squeezy, the moment of purchase is your best chance to engage a new customer. The problem is that Lemon Squeezy handles billing and Loops handles email — and nothing connects them out of the box.

Most builders handle this manually: exporting CSVs from Lemon Squeezy and uploading them to Loops once a week. Others write custom server-side code to bridge the two APIs. Both approaches break down quickly. CSVs go stale, custom code needs maintenance, and neither option delivers the instant onboarding sequence buyers expect right after checkout.

This is exactly the kind of integration n8n handles cleanly. With a small workflow, you can wire Lemon Squeezy purchase webhooks directly into the Loops API — adding every buyer to the right contact list and triggering their onboarding sequence automatically, in real time.

What You'll Build

This workflow listens for new order and subscription events from Lemon Squeezy. When a purchase fires, n8n receives the event, extracts the buyer's name and email, and creates or updates their contact record in Loops. It then triggers the appropriate email sequence based on which product or plan was purchased.

The result: a buyer completes checkout and receives their first onboarding email within seconds, without any manual work on your end.

Before You Start

You'll need:

  • A Lemon Squeezy account with at least one active product or subscription plan
  • A Loops account with at least one loop (email sequence) already configured
  • An n8n instance — self-hosted or n8n Cloud — accessible via a public URL for receiving webhooks

The n8n Workflow: Step by Step

Step 1: Webhook Trigger Node

Add a Webhook Trigger node as the entry point of your workflow. This node generates a unique URL that you will register inside Lemon Squeezy's webhook settings. Set the HTTP method to POST and copy the webhook URL before moving on.

In your Lemon Squeezy dashboard, navigate to Settings > Webhooks, click "Add endpoint," and paste the n8n URL. Subscribe to at minimum the order_created and subscription_created events. If you want to handle subscription cancellations, also add subscription_cancelled.

Step 2: Set Node — Normalize the Payload

Lemon Squeezy's webhook payload nests customer data inside a data.attributes object. Use a Set node to extract the fields you need and map them to clean, flat variable names: customerEmail, customerName, productName, and variantName.

For an order_created event, the relevant fields are:

  • Email: data.attributes.user_email
  • Name: data.attributes.user_name
  • Product name: data.attributes.first_order_item.product_name
  • Variant name: data.attributes.first_order_item.variant_name

Keeping these as clean variables makes every downstream node simpler and easier to debug.

Step 3: IF Node — Route by Event Type

Not every Lemon Squeezy event should trigger the same email sequence. Add an IF node that checks the meta.event_name field from the original webhook payload.

Route subscription_created events down one branch (recurring subscribers) and order_created events down another (one-time buyers). You can expand this later to a Switch node if you need separate paths for multiple products or plans.

Step 4: HTTP Request Node — Create or Update the Loops Contact

For each branch, add an HTTP Request node that calls the Loops contacts API. Use a POST request to https://app.loops.so/api/v1/contacts/upsert, set the Content-Type header to application/json, and pass your Loops API key as a Bearer token in the Authorization header.

The request body should include the buyer's email address, first name, and any custom attributes you want to store — such as the product name or subscription tier. Loops will create a new contact if the email does not already exist, or update the existing record if it does.

Storing the product name as a contact attribute is worth doing even if you only have one product today. It makes segmentation much easier as your catalog grows.

Step 5: HTTP Request Node — Trigger the Email Loop

Once the contact is created or updated, add a second HTTP Request node that calls https://app.loops.so/api/v1/events/send. This endpoint triggers a specific loop for a contact. Pass the buyer's email address and the event name you defined when setting up your loop inside Loops — for example, new_subscriber_onboarding or one_time_purchase_welcome.

The event name in your n8n workflow must match exactly what you configured in Loops. If there is a mismatch, Loops will accept the request but no sequence will fire, so double-check the spelling before testing end-to-end.

Step 6: Handle Errors with an IF Node

After each HTTP Request node, add a quick IF node that checks whether the response status code is in the 200–299 range. If either API returns an error, route those failed payloads to a simple log — a Google Sheet row or a direct Slack message works well. This gives you a recovery path: you can replay any failed contact manually without losing the sale data.

Handling Renewals and Cancellations

If you sell subscriptions, two more events are worth handling.

For subscription_payment_success, you can skip the contact creation step (the subscriber already exists) and instead use an HTTP Request node to update a custom attribute in Loops — something like last_renewal_date or subscription_status: active. This lets you segment active subscribers from churned ones when sending future campaigns.

For subscription_cancelled, update the contact's status attribute and optionally trigger a win-back loop by sending a different event name to the Loops events endpoint. The structure is identical to the onboarding path; only the event name changes.

Segmenting Buyers by Product

If you sell more than one product, insert a Switch node immediately after the Set node and branch on the productName variable. Each branch points to a different event name in Loops, so buyers of your starter plan get a different onboarding sequence than buyers of your pro plan.

This kind of purchase-level segmentation would otherwise require custom code or a complex Loops audience rule. In n8n, it is a Switch node with one branch per product — about five minutes to configure.

Practical Benefits

Wiring Lemon Squeezy to Loops with n8n delivers several concrete advantages:

  • Instant onboarding. Buyers receive their first email within seconds of checkout, when attention and intent are at their highest.
  • Accurate contact data. Every Loops contact carries the product name, plan tier, and purchase date as attributes — set automatically, with no manual tagging.
  • Event-driven segmentation. Different products and plan levels route to different sequences without any changes to your email platform.
  • Full ownership. Because the integration logic lives in your n8n workflow, you can swap either tool — Lemon Squeezy for another payment provider, Loops for another email platform — without rebuilding a third-party zap or rewriting server code.

Start with a Template

If you want to skip the setup time, n8nresources.dev/templates includes pre-built n8n workflows for common integrations like this one. You can import the workflow directly into your n8n instance, fill in your API keys, and have the Lemon Squeezy-to-Loops pipeline running in minutes. The template library also covers hundreds of other tool combinations across CRM, DevOps, HR, e-commerce, and analytics — all ready to deploy and customize.

Enjoyed this article?

Share it with others who might find it useful