Browse the docs

Agent setup guide

PayPal Payment Thank-You

When a PayPal invoice is paid, a thank-you in your voice is drafted for your approval, sent from Gmail and noted on the HubSpot contact.

Available About 10 min to set up

What it does

When a PayPal invoice is paid, a thank-you in your voice is drafted for your approval, sent from Gmail and noted on the HubSpot contact.

  • Starts when a PayPal invoice is paid.
  • Looks the customer up in HubSpot; AI drafts a short thank-you in your voice and a payment note, copying the invoice number and amount as PayPal gives them.
  • A second AI step checks only the wording and quotes anything it blocks; you approve every email.
  • Code checks the recipient, leftover placeholders and the wording verdict before sending from your Gmail.
  • Adds the payment note to the HubSpot contact when there is one.

What it needs

  • A paid plan (agents run live on paid plans).
  • An AI provider key (Settings → AI Providers).
  • PayPal: the Client ID and Secret of your own REST app (developer.paypal.com → Apps & Credentials, Live tab; a PayPal Business account).
  • HubSpot and Gmail, connected in Settings → Integrations.

What it doesn't do

  • It doesn't record payments in an accounting app or move money.
  • It never sends without your approval, and never offers discounts or rewards that aren't in your rules.
  • It doesn't create HubSpot contacts for new customers.

Availability and plans

Available

Its workflow is built and tested, and every app it needs is live. You can get it and set it up now.

Included free on the Enterprise plan; on other paid plans it's a one-time purchase per workspace (the price is on the Agents page). The Agents page in the app always shows its current status.

Before you start

  • A paid plan: agents run live, and the Free plan only runs Dry Runs.
  • An AI provider key (OpenAI, Anthropic, Google and more) in Settings → AI Providers. AI usage is billed by your provider.
  • These apps, connected in Settings → Integrations: PayPal, HubSpot and Gmail.
  • The app it watches, connected in Settings → Integrations (the agent starts from an app event).
  • About 10 minutes.

Set it up step by step

Get the agent first (buy it, or it's already yours when your plan includes it), then in Agents → My agents press “Set up this agent”. That creates the agent's workflow in your workspace (it counts towards your plan's workflow limit) and opens the canvas with a setup checklist above it. Each item links to the exact place to go and ticks itself off when it's done.

1. Connect your AI provider

The AI steps run on your own key (OpenAI, Anthropic, Google and more). Add one in Settings → AI Providers.

2. Connect PayPal

Connect PayPal with your REST app's Client ID and Secret (Settings → Integrations → PayPal).

3. Connect HubSpot

Connect the HubSpot account your customers are in.

4. Connect Gmail

Connect the Gmail account the thank-you is sent from.

5. Pick your PayPal account

Open the trigger and pick your PayPal connection.

SettingWhat to enterIn step
PayPal account (paid invoices)The PayPal connection whose paid invoices start the agent. Pick your connected PayPal account.“Invoice paid”

6. Write your thank-you rules

Open “Find the customer in HubSpot” and pick your account, then replace the placeholder in “Write the thank-you”.

SettingWhat to enterIn step
HubSpot accountThe HubSpot account your customers are in. Pick your connected HubSpot account.“Find the customer in HubSpot”
Your thank-you rulesReplace the placeholder with your business name, tone, sign-off and anything to mention (with exact links). It starts as “[YOUR BUSINESS NAME, YOUR TONE, YOUR SIGN-OFF, AND ANYTHING TO MENTION IN A THANK-YOU (E.G. HOW TO BOOK THE NEXT JOB OR LEAVE A REVIEW, WITH THE EXACT LINK)]” until you replace it.“Write the thank-you”

7. Pick Gmail and HubSpot

Open “Send it from Gmail”, “Look up the contact” and “Note it in HubSpot” and pick your accounts.

SettingWhat to enterIn step
Gmail accountThe Gmail account the thank-you is sent from. Pick your connected Gmail account.“Send it from Gmail”
HubSpot account (lookup)The same HubSpot account. Pick your connected HubSpot account.“Look up the contact”
HubSpot account (note)The same HubSpot account. Pick your connected HubSpot account.“Note it in HubSpot”

8. Test it with Dry Run

Press Dry Run: the agent runs on sample data with no messages sent and nothing written to your apps.

9. Switch the trigger on

Open the trigger and click “Activate app trigger”: invoices paid from now on start the agent.

How it works

The agent is a normal workflow with 15 steps (2 AI steps, with a person approving in Reviews). You can open, edit and monitor it like any other workflow.

  • Invoice paid — Starts on “Invoice paid” in PayPal (an app event). Starts when a PayPal invoice is paid. PayPal is checked every few minutes.
  • Find the customer in HubSpot — HubSpot: Find records. Looks up the customer's HubSpot contact by the invoice email.
  • Write the thank-you — AI step (runs on your AI provider key). AI writes a short thank-you email in your voice and a plain note for the HubSpot contact, copying the invoice facts as PayPal gives them.
  • Final wording check — AI step (runs on your AI provider key). A second AI step checks only the wording against clear rules (no invented offers or promises) and quotes any sentence it blocks.
  • Approve the thank-you — A person approves or rejects it in Reviews (the run waits). A person reads the email (and the AI check's verdict) in Reviews, edits it if needed and approves. Nothing is emailed without this approval.
  • Not approved — Kept in the run history. Branch: Rejected. Rejected: nothing was sent or noted.
  • Check before sending — Step. Branch: Approved. In code, after approval: exactly one valid recipient, no placeholders left, and the wording check didn't block it.
  • Send it? — Decision: picks the branch to follow. Emails that pass are sent; the rest are held with the reason.
  • Held — Kept in the run history. Branch: Held. The email failed a check (recipient, placeholders or the wording check); nothing was sent. The reason is in the run history.
  • Send it from Gmail — Gmail: Send an email. Branch: Passes. Sends the approved thank-you from your Gmail account.
  • In HubSpot? — Decision: picks the branch to follow. In code, from the HubSpot search: the note is added only when the contact exists.
  • Look up the contact — HubSpot: Find records. Reads the HubSpot contact again so the note goes on the right record.
  • Note it in HubSpot — HubSpot: Add a note. Branch: Found. Adds the payment note to the customer's HubSpot contact.
  • Done — Kept in the run history. The run history keeps the invoice, the email and the note.
  • Not in HubSpot — Kept in the run history. Branch: Not found. The customer isn't a HubSpot contact: the thank-you was sent, no note was added.

Test it with Dry Run

Press Dry Run in the canvas. The agent runs on the sample data stored on its trigger (the “Sample data for Dry Run” box), so you can check every step's output before anything is live. The sample has the same shape as a real event from the app.

Sample data fields

id, status, invoice_number, invoice_date, due_date, currency, total, due_amount, paid_amount, recipient_email, recipient_name, recipient_business, reference, last_payment_date, invoice.

  • Nothing is sent or written: app actions, emails and Slack posts are simulated, and AI steps don't call your AI provider.
  • Approval steps use the Dry Run decision you pick in the step's settings (approved, rejected or timeout), so you can try each branch.

Go live

  • Open the trigger and click “Activate app trigger”: invoices paid from now on start the agent.
  • Activating the app trigger needs the trigger's connected account. The first check only remembers what's already there, so older items don't start runs; the same item never starts two runs.
  • The setup checklist adds a “paid plan” item before activation: live runs need a paid plan (the Free plan only runs Dry Runs).
  • When every checklist item is done and the trigger is on, the checklist says “Live — this agent is running”. Follow its runs in the workflow's History tab and in Analytics → Agents.

Questions

Is the thank-you sent automatically?

No. Every email waits for your approval in Reviews.

What if the customer isn't in HubSpot?

The thank-you is still sent after approval; the note is only added when the contact exists.

Does it record the payment in my accounting app?

No. It notes the payment on the HubSpot contact; PayPal already marks the invoice paid.

Troubleshooting

  • “No AI provider connected” or a rejected key: connect or fix the key in Settings → AI Providers, then press Test there.
  • A checklist item stays unticked: the setting is still empty or still contains its placeholder text. Open the step from the checklist and fill it in.
  • An app step fails with “Needs reconnect”: the account's access was revoked or expired. Reconnect it in Settings → Integrations.
  • No runs start: activate the app trigger with a connected account. Only items created after activation start runs.
  • A run shows as paused: it's waiting for someone in Reviews to approve or reject it.
  • A step failed: open the run in History and check that step in the Trace tab for the error and what it received.

Generated from the agent's own workflow, so it always matches what the agent does. Last updated .