Auto-send Adyen payment links for Airtable invoices

Every 15 minutes, generate an Adyen payment link for every ready invoice in Airtable, save it to the row, and email the customer.

Deterministic Code
AdyenAirtableGmailFinanceOperationsEmail AutomationData Sync
PromptCreate

Build a deterministic code workflow that sweeps my Airtable 'Invoices' table every 15 minutes and generates Adyen payment links for any new invoices that do not yet have one. Trigger: cron, every 15 minutes.

My Airtable 'Invoices' table has columns for customer name, customer email, amount, currency, description, Status, Payment Link, and Payment Link ID. Ready-to-send invoices have Status = 'Ready' and an empty Payment Link column.

Step 1: Call Airtable List Records on the 'Invoices' table with a filterByFormula that selects rows where {Payment Link} is empty and {Status} = 'Ready'. Handle Airtable pagination via the offset parameter until all matching rows have been fetched.

Step 2: For each returned row, skip it if the customer email field is missing or does not look like a valid email address. Then call Adyen Create Payment Link with the row's amount, currency, and description. The Adyen amount object must use minor units — multiply two-decimal currencies (USD, EUR, GBP, etc.) by 100 and round to an integer, use whole numbers for zero-decimal currencies like JPY, and multiply three-decimal currencies like BHD by 1000. Set the Adyen reference field to the Airtable record ID so a downstream reconciliation step can match paid links back to invoices. Include the merchantAccount from configuration in the request body.

Step 3: Call Airtable Update Record on the same row to write the returned Adyen payment URL into the Payment Link column, the returned Adyen link id into the Payment Link ID column, and flip Status to 'Sent'. Do this before sending the email so a downstream email failure never causes the same link to be generated twice on the next sweep.

Step 4: Call Gmail Send a Message to the customer's email with a short subject like 'Your invoice from {business name}' and a body that includes the customer name, the invoice description, the amount and currency, and the payment link URL. If the Gmail send fails for a single row, log the error and continue processing the rest of the batch rather than aborting the whole run.

The workflow should be idempotent: rows that already have a Payment Link or are not in Status 'Ready' must never be re-processed. Every step is a known node, so build this as deterministic code with no reasoning.

Additional information

What does this prompt do?
  • Sweeps your Airtable 'Invoices' table every 15 minutes and picks up rows marked Ready that still need a payment link.
  • Creates a hosted Adyen payment link for each invoice using the amount, currency, and description on the row.
  • Writes the payment URL and link ID back onto the Airtable row and flips its status to Sent so it will not be processed twice.
  • Emails the customer their payment link from Gmail, skipping any row that is missing a valid email.
What do I need to use this?
  • An Airtable base with an 'Invoices' table that includes customer name, customer email, amount, currency, description, a 'Payment Link' column, and a 'Status' column.
  • An Adyen account with a merchant account configured for payment links.
  • A Gmail account to send the outbound payment emails from.
How can I customize it?
  • Change the schedule (for example, run once an hour instead of every fifteen minutes).
  • Adjust the Airtable filter — swap the 'Ready' status value, or add extra rules like 'only invoices over $500'.
  • Rewrite the email subject and body copy, add your logo and payment terms, or send a plain reminder instead of the initial request.

Frequently asked questions

How does the workflow avoid emailing the same customer twice?
Each row is only picked up when its 'Payment Link' column is empty and its status is Ready. As soon as the link is created, the workflow writes it back and flips the status to Sent, so the next sweep skips that row automatically.
What happens if a row is missing a customer email?
The workflow skips it. The Adyen link is not created and the row stays in its current state so you can add the email later — the next sweep will pick it up.
Do amounts need to be formatted in a special way?
You enter normal decimal amounts in Airtable (like 129.50). The workflow converts them to the format Adyen expects behind the scenes, including for zero-decimal currencies like JPY.
Can I use this with Adyen test mode first?
Yes. Point the workflow at your Adyen test API credentials and a test merchant account. Every payment link produced will be a test link until you swap in live credentials.
Can I reconcile paid links back to the original invoice later?
Yes. The workflow uses the Airtable record ID as the Adyen reference on every link, so a follow-up reconciliation step can match paid payments back to the exact row.

Stop copy-pasting payment links into invoice emails.

Let this workflow generate the Adyen link, log it in Airtable, and email the customer while you focus on the work.