How to Build Automated Client Onboarding Workflows in Antigravity with Intake Forms, Document Generation & CRM Sync
How to Build Automated Client Onboarding Workflows in Antigravity
Manual client onboarding is time-consuming and error-prone. With Antigravity, you can build fully automated onboarding workflows that trigger from an intake form submission, generate personalized documents, and sync everything to your CRM — all without writing a custom backend. This guide walks you through every step.
Prerequisites
- An Antigravity workspace (Free tier or above)- Node.js 18+ installed- A CRM account (Salesforce, HubSpot, or Pipedrive) with API access- Basic familiarity with YAML configuration
Step 1: Install and Configure the Antigravity CLI
Start by installing the Antigravity CLI globally and authenticating with your workspace.
npm install -g @antigravity/cli
antigravity auth login —api-key YOUR_API_KEY
antigravity workspace select —name “my-agency”
Verify your connection is active:
antigravity status
You should see your workspace name, active plan, and connected integrations listed in the output.
Step 2: Initialize the Onboarding Workflow Project
Create a dedicated workflow project directory and scaffold the configuration files:
antigravity workflow init client-onboarding
cd client-onboarding
This generates the following structure:
client-onboarding/
├── workflow.yaml
├── triggers/
│ └── intake-form.yaml
├── steps/
│ ├── generate-docs.yaml
│ └── crm-sync.yaml
└── templates/
└── welcome-letter.hbs
Step 3: Create the Intake Form Trigger
Open triggers/intake-form.yaml and define the fields your intake form collects:
trigger:
type: form
name: client_intake
fields:
- name: client_name
type: text
required: true
- name: client_email
type: email
required: true
- name: company_name
type: text
required: true
- name: service_tier
type: select
options: ["starter", "professional", "enterprise"]
required: true
- name: project_start_date
type: date
required: true
webhook_url: https://hooks.antigravity.io/v1/workflows/{{workflow_id}}/trigger
on_submit: start_workflow
Deploy the trigger to generate an embeddable form URL:
antigravity trigger deploy triggers/intake-form.yaml
The CLI returns a public form URL and an embed snippet you can place on your website or share directly with clients.
Step 4: Add the Document Generation Step
Edit steps/generate-docs.yaml to define which documents are automatically created when a form is submitted:
step:
name: generate_onboarding_docs
type: document_generation
depends_on: client_intake
documents:
- template: templates/welcome-letter.hbs
output_name: “Welcome_Letter_{{client_name}}.pdf”
format: pdf
- template: templates/service-agreement.hbs
output_name: “Service_Agreement_{{company_name}}.pdf”
format: pdf
e_signature: true
delivery:
method: email
to: “{{client_email}}”
subject: “Welcome aboard, {{client_name}}!”
body_template: templates/welcome-email.hbs
Create the Handlebars template at templates/welcome-letter.hbs:
Welcome, {{client_name}}
Thank you for choosing our {{service_tier}} plan.
Your project is scheduled to begin on {{project_start_date}}.
Company: {{company_name}}
Step 5: Configure the CRM Sync Step
Edit steps/crm-sync.yaml to push onboarding data to your CRM automatically:
step:
name: sync_to_crm
type: crm_sync
depends_on: generate_onboarding_docs
connector: hubspot
credentials:
api_key: YOUR_CRM_API_KEY
actions:
- action: create_contact
mapping:
firstname: “{{client_name | split ’ ’ | first}}”
lastname: “{{client_name | split ’ ’ | last}}”
email: “{{client_email}}”
company: “{{company_name}}”
- action: create_deal
mapping:
dealname: “Onboarding — {{company_name}}”
pipeline: default
dealstage: appointmentscheduled
amount_tier: “{{service_tier}}”
- action: add_note
mapping:
body: “Auto-onboarded on {{project_start_date}}. Documents sent via email.”
To use Salesforce or Pipedrive instead, change the connector value and adjust the field mappings to match your CRM schema. Run the following to verify your mapping:
antigravity step validate steps/crm-sync.yaml —dry-run
Step 6: Wire It All Together in workflow.yaml
Open the root workflow.yaml and connect your trigger and steps:
workflow:
name: client_onboarding
version: 1.0
trigger: triggers/intake-form.yaml
steps:
- steps/generate-docs.yaml
- steps/crm-sync.yaml
on_failure:
notify:
channel: slack
webhook: YOUR_SLACK_WEBHOOK_URL
message: "Onboarding workflow failed for {{client_name}}. Check logs."
## Step 7: Deploy and Test
Deploy the complete workflow to your Antigravity workspace:
antigravity workflow deploy --file workflow.yaml --env production
Run a test submission to validate the entire pipeline:
antigravity workflow test client_onboarding --data '{
"client_name": "Jane Doe",
"client_email": "jane@example.com",
"company_name": "Acme Corp",
"service_tier": "professional",
"project_start_date": "2026-04-01"
}'
Check execution logs:
antigravity logs --workflow client_onboarding --last 5
## Pro Tips for Power Users
- **Conditional branching:** Add condition: "{{service_tier}} == 'enterprise'" to any step to create tier-specific onboarding paths, such as assigning a dedicated account manager only for enterprise clients.- **Parallel steps:** Set parallel: true on independent steps like document generation and CRM sync to cut workflow execution time in half.- **Custom webhooks:** Use type: webhook steps to notify external services (Slack, Zapier, or internal APIs) at any point in the workflow.- **Version pinning:** Use antigravity workflow deploy --version 1.0 --pin to lock a stable workflow version while iterating on a v2 draft.- **Template previews:** Run antigravity template preview templates/welcome-letter.hbs --data sample.json to preview generated documents before deploying.
## Troubleshooting Common Errors
| Error | Cause | Solution |
|---|---|---|
AUTH_EXPIRED | API key or session token has expired | Run antigravity auth login --api-key YOUR_API_KEY to re-authenticate |
CRM_FIELD_MAPPING_ERROR | A mapped CRM field does not exist in your CRM schema | Run antigravity step validate steps/crm-sync.yaml --dry-run and verify field names match your CRM |
TEMPLATE_RENDER_FAIL | Handlebars variable is missing or misspelled | Ensure all {{variables}} in templates match the field names in your trigger definition |
WEBHOOK_TIMEOUT | External service did not respond within 30 seconds | Increase timeout with timeout: 60 in the step config or check the external service status |
DUPLICATE_CONTACT | CRM already has a contact with the same email | Add deduplicate: true and dedup_field: email to your CRM sync action to update instead of create |
Can I use Antigravity onboarding workflows with CRMs other than HubSpot?
Yes. Antigravity supports native connectors for HubSpot, Salesforce, and Pipedrive out of the box. For other CRMs, you can use the generic type: webhook step to send data to any REST API endpoint. Simply replace the connector field with webhook and provide the target URL and payload mapping in your step configuration.
How do I add e-signature collection to generated documents?
Add e_signature: true to any document entry in your generate-docs.yaml step. Antigravity integrates with built-in e-signature functionality that tracks signing status. You can add a conditional step that waits for signature completion before proceeding to CRM sync by using wait_for: signature_complete in the depends_on configuration.
Is there a limit to how many onboarding workflows can run concurrently?
On the Free tier, Antigravity allows up to 50 concurrent workflow executions. The Professional plan supports 500, and Enterprise plans offer unlimited concurrency. You can monitor active executions at any time using antigravity workflow stats client_onboarding, which shows queue depth, average completion time, and failure rate.