Provision tenant subdomains from Airtable in Cloudflare
When a new customer is added to your Airtable tenants list, set up their subdomain in Cloudflare and post a confirmation in Slack, with no manual work.
Build an agent workflow that provisions a tenant subdomain in Cloudflare every time a new customer record appears in our Airtable Tenants base, then writes the result back to Airtable and posts a confirmation in Slack.
Trigger: an Airtable poll trigger on the Tenants table, event type new_record. The poll should pass the new row's record ID and field values into the agent.
On each new row, the agent should:
1. Read the new Airtable record using Airtable Get Record so it has the canonical, latest version of these fields: company name, requested subdomain (may be empty), target origin (either an IP address for a proxied A record or a hostname for a CNAME target), and tenant tier or notes.
2. Decide the subdomain. If the requested subdomain field is filled, normalize it (lowercase, strip whitespace and punctuation, hyphenate spaces). If it is empty, derive a candidate from the company name using the same rules. Reserve a short list of forbidden labels (www, api, admin, app, mail, staging) and pick an alternative if one of those is requested.
3. Find the Cloudflare zone for our product domain by calling Cloudflare List Zones and matching on the configured product domain (the user should configure this when they set the workflow up, for example tenants.example.com or example.com).
4. Check for collisions by calling Cloudflare List DNS Records filtered to the chosen full hostname inside that zone. If a record already exists, the agent should reason through a safe alternative, for example appending -2, -3, or a short slug from the tenant tier, and re-check until it finds a free name. Cap the retry loop at 5 attempts and surface the failure to Slack if none are free.
5. Create the DNS record by calling Cloudflare Create DNS Record. If the target origin looks like an IPv4 address, create a proxied A record. If it looks like a hostname, create a proxied CNAME pointing at it. Default proxied to true, TTL to 1 (auto). Capture the returned record ID.
6. Update the Airtable row using Airtable Update Record. Write back: the final chosen subdomain, the full provisioned URL (https://chosen-subdomain.product-domain), the Cloudflare record ID, the DNS record type used (A or CNAME), and a Provisioned At timestamp. Also set a status field like Provisioned or Ready.
7. Post a confirmation in Slack using Slack Send a Message to a customer success channel (configurable). Include the company name, the new URL as a clickable link, the record type, and the Airtable record link so the team can jump back to it. If the agent had to deviate from the requested subdomain or hit any retries, call that out clearly in the message.
If the Cloudflare API returns an error (zone not found, permission denied, validation error), do not update Airtable to Provisioned. Instead update a Status field to something like Failed, write the error message into a notes field, and post a failure message into the same Slack channel asking the team to take a look.
Configurable inputs the workflow should ask the user for when they set it up: Airtable base and table for tenants, the Cloudflare product domain to provision under, the default subdomain pattern (for example {slug}.product-domain), the Slack channel for confirmations, and the optional list of reserved subdomain labels.
Additional information
What does this prompt do?
- Watches an Airtable base where your team tracks new tenant signups and reacts the moment a row is added.
- Picks a safe, clean subdomain from the company name, checks Cloudflare to make sure nothing else owns it, and falls back to a sensible alternative if it is taken.
- Creates the DNS record in Cloudflare pointing the new subdomain at your app, writes the final URL back to the Airtable row, and posts a confirmation in your customer success Slack channel.
What do I need to use this?
- A Cloudflare account with the domain you use for tenant subdomains already added.
- An Airtable base with a table for new tenants that captures at least the company name and the app server they should point at.
- A Slack workspace with a channel where your customer success team wants the launch confirmations to land.
How can I customize it?
- Change which Airtable base, table, and fields are watched, so it fits whatever intake list your team already keeps.
- Swap the Slack channel, message format, or even route different tenant tiers to different channels.
- Adjust how the subdomain is chosen, for example always lowercase, strip company suffixes like Inc or LLC, or reserve certain words.
Frequently asked questions
What happens if the subdomain we want is already taken?
Do we need to write any code or run a server?
Can it point the subdomain at a load balancer or a different origin per tenant?
Will it touch existing DNS records?
Where does the confirmation message go?
Stop hand-rolling tenant subdomains every time a customer signs up.
Connect Airtable, Cloudflare, and Slack once, and Geni provisions each new tenant the moment they land in your intake table.