Send Typeform leads to ActiveCampaign with a Sheets backup

By General Input

Every new Typeform response becomes a tagged ActiveCampaign contact and a fresh row in your lead log spreadsheet. No copy-paste, no missed leads.

Integrations

  • Typeform
  • ActiveCampaign
  • Google Sheets

Type

Deterministic Code

Categories

  • Sales
  • Marketing

Build a code workflow triggered by a Typeform webhook on the form_response event. Typeform will POST the response payload directly to the workflow's webhook URL (set up via the form's Connect tab in Typeform). Every new submission needs to (1) land in ActiveCampaign as a tagged contact and (2) append a backup row to a Google Sheets lead log so we always have a record, even when ActiveCampaign is skipped.

Parse the Typeform payload. From form_response.answers, extract email (required), first_name, last_name, and phone by matching the answer's field.type (email, text/short_text for names, phone_number). Also pull form_response.definition.title (the form title) and form_response.submitted_at. Build a deterministic tag slug from the form title by lowercasing, replacing non-alphanumeric runs with a single hyphen, trimming hyphens, and prefixing typeform-. Example: 'Demo Request Form' becomes typeform-demo-request-form.

Validate the email. If it's missing or fails a basic format check (one @, one dot in the domain, no whitespace), skip the ActiveCampaign branch entirely and jump straight to logging with status=skipped and a short reason. Do not silently drop the response.

ActiveCampaign branch (only when email is valid):

1) Call ActiveCampaign Create Contact in sync mode (POST /contact/sync) with email, firstName, lastName, and phone. This upserts on email match, so we get back the contact id whether the contact is new or existing. Capture the returned contact.id.

2) Resolve the tag id for the derived tag slug. First call ActiveCampaign List Tags filtered by the tag name (GET /tags?search=<tag>). If a tag with an exact name match exists, reuse its id. Otherwise call Create Tag (POST /tags) with tagType=contact and the derived slug as the tag name, then use the returned id.

3) Call Add Tag to Contact (POST /contactTags) with body { contactTag: { contact: <contactId>, tag: <tagId> } }. Treat a duplicate-association error as success (the tag is already on the contact).

Google Sheets branch (always runs, both for success and skipped):

Call Append Values on the configured spreadsheet and tab (configurable inputs: spreadsheetId, sheetName, default range like Sheet1!A:H, valueInputOption=USER_ENTERED). Append a single row with columns in this order: submitted_at, email, first_name, last_name, phone, form_title, activecampaign_contact_id (empty when skipped), status (synced or skipped), and a short note (e.g. missing email or invalid email format) when skipped.

Error handling: respect ActiveCampaign's 5 req/sec limit and Retry-After header on 429. If the Create Contact or tag steps fail after retries, still append the row to Google Sheets with status=error and the error message in the note column so the lead is never lost. Return a 200 to Typeform on every accepted submission so it does not retry forever.

Inputs the user should configure when installing: the Typeform connection (for webhook setup), the ActiveCampaign credential (apiKey + accountName), the Google credential, the target spreadsheetId, the sheet/tab name, and an optional override for the tag prefix (default typeform-).

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seatsBuild audience segments from product usage and push to LoopsTurn the people who engage with your posts into Pipedrive leads