โ AI Automation Mastery
Day 3 of 21
Your First Real Automation
Anatomy of an Automation
Every automation has the same three parts: a trigger, one or more actions, and optionally a condition layer in between. Understanding this structure makes every workflow you look at immediately readable.
The trigger is what starts the workflow. Common triggers: a new row in a Google Sheet, a webhook from your website form, a new email in Gmail, a new Slack message, a scheduled time (cron), or an API call from your application. Triggers are always the first node in n8n.
Actions are what the workflow does in response. Common actions: create a record in your CRM, send an email or Slack message, update a spreadsheet, call an API, run some code, send a webhook to another system.
Conditions sit between trigger and action to route the workflow differently based on the data. If the lead is from Australia, route to one Slack channel; if from the US, route to another. If the email contains the word 'urgent', escalate it. If the deal value is over $10k, notify the founder directly.
Today we're building a classic first automation: when someone fills out your contact form, parse their message, send yourself a Slack notification with the key details, and add them to a Google Sheet for tracking. This touches triggers (webhook), data transformation, and multiple actions โ it's a complete introduction to the workflow model.
Building the Lead Capture Workflow
Here's the step-by-step build in n8n. Follow along in your own instance.
Step 1: Create a new workflow. Name it 'Lead Capture'.
Step 2: Add a Webhook trigger node. Set it to POST, copy the webhook URL. This is the URL your form will send data to.
Step 3: Test the webhook. Use a tool like Webhook.site or your actual form โ POST some test data. You'll see the incoming payload in n8n's debug panel. Examine the structure carefully.
Step 4: Add a Set node to extract and rename the fields you want. Rename 'body.name' to 'name', 'body.email' to 'email', 'body.message' to 'message'.
Step 5: Add a Slack node. Connect it to your Slack workspace, choose a channel, and compose a message using the variables: 'New lead from {{$json.name}} ({{$json.email}}): {{$json.message}}'
Step 6: Add a Google Sheets node. Create a sheet called 'Leads' with columns Name, Email, Message, Date. Map the fields from your Set node.
Step 7: Connect your form to send POST requests to your webhook URL. Test with a real submission.
You now have a live automation. Every form submission will notify you in Slack and log to Sheets simultaneously within seconds. This alone saves 5-10 minutes per lead for many founders.
โก Today's Action
Build the lead capture workflow described above. If you don't have a contact form, use Typeform or a simple HTML form. Get at least one real test submission flowing through your workflow.
๐ก Pro Tip
Always test your workflow with 3-4 different data scenarios before calling it done. Edge cases in real data (empty fields, special characters, different formats) will break naive automations within the first week.