n8n Automation Mastery: Build, Deploy & Sell AI Workflows and Agents (Video Course)
Transform how you work by building automations and AI agents with N8N’s visual platform,no advanced coding needed. Learn to connect your favorite apps, streamline tedious tasks, and even monetize your solutions with practical, real-world workflows.
Related Certification: Certification in Building, Deploying, and Monetizing AI Workflows with n8n

Also includes Access to All:
What You Will Learn
- Build node-based workflows in n8n
- Manipulate JSON using expressions and dot notation
- Apply string, number, array, and datetime functions
- Deploy and self-host n8n (Render, Railway, Docker)
- Create, test, and package AI-powered automations and agents
- Implement validation, security, and monetization best practices
Study Guide
N8N FULL COURSE: BUILD & SELL AI AUTOMATIONS + AGENTS
Introduction: Why Learn N8N and AI Automations?
Imagine automating your tedious work, connecting your favorite apps, and deploying AI agents that take action on your behalf,all with a visual interface that requires little to no coding. That’s the promise of N8N, an open, extensible workflow automation platform built for creators, entrepreneurs, tech enthusiasts, and anyone looking to free up their time and unlock new business opportunities.
This course will guide you from zero to advanced with N8N: you’ll learn not just how to build automations, but how to sell them, deploy your own AI-powered agents, and even self-host for privacy or cost savings. We’ll cover every concept, function, and pattern you need to create robust, scalable, and valuable automations. You’ll see how data flows through nodes, how to manipulate and transform information, and how to build workflows that solve real problems for yourself and clients.
Every section is packed with detailed explanations and practical examples. By the end, you’ll have the skills to build, deploy, and monetize AI-powered automations with N8N.
Getting Started: What is N8N?
N8N (pronounced “n-eight-n”) is a workflow automation platform that lets you connect different apps and services, automate repetitive tasks, and orchestrate data flows without writing traditional code. Its visual, node-based interface makes it accessible, while its extensibility and open nature make it powerful for advanced users.
You build workflows by dragging and connecting nodes. Each node represents an operation,reading an email, sending a message, calling an AI, transforming data, and so on. The true magic lies in how you combine these nodes, manipulate data between them, and create automations that are both smart and flexible.
Core Concepts and Terminology in N8N
Before you can build anything meaningful, you must understand how N8N represents and processes data. Let’s break down the essential building blocks and their terminology.
Nodes and Workflows:
Workflows are the backbone of N8N automations. They’re made of interconnected nodes, each performing a specific action or operation. Nodes can trigger workflows (like when an email arrives), manipulate data, call external services, or run AI models. As data passes through each node, it gets transformed, filtered, or enriched according to your instructions.
Example 1: A workflow starts with a Gmail Trigger node (when a new email arrives), passes the email content to an AI node that summarizes it, and then sends the summary to Slack.
Example 2: A webhook node receives requests from a website, processes the data, and adds it to a Google Sheet.
Data Structure and Representation (JSON):
N8N uses JSON (JavaScript Object Notation) to represent all data internally. JSON is a simple, readable format that organizes information as key-value pairs and supports nesting.
Example 1: A JSON object representing a user:
{ "name": "Alice", "email": "alice@example.com", "preferences": { "newsletter": true, "theme": "dark" } }Example 2: An array of JSON objects representing a list of tasks:
[ {"task": "Email client", "done": false}, {"task": "Prepare report", "done": true} ]Understanding JSON is crucial, as nearly every interaction with N8N data involves reading, updating, or manipulating JSON.
Variables and Dot Notation:
You access data from previous nodes or workflow inputs using variables. The standard way is {{ $json.variableName }}. The dot notation lets you drill into nested objects (e.g., $json.user.email).
Example 1: To use the email address from a previous node: {{ $json.email }}
Example 2: To access the first item in an array: {{ $json.items[0] }}
Mastering variable referencing is fundamental for dynamic, personalized automations.
Data Types in N8N:
Data in N8N comes in several types. Here’s what you’ll encounter and how to use them:
- Strings: Text data, always in quotes. E.g., "hello world". Strings are used for names, emails, messages, etc.
- Numbers: Integer or floating-point values. Used for calculations, comparisons, timestamps, etc.
- Booleans (Bool): True/false values (can be true/false, 1/0, or sometimes "true"/"false" as strings).
- Arrays: Ordered lists, represented by square brackets. E.g., ["red", "blue", "green"].
- Objects: Unordered collections of key-value pairs, represented by curly braces. E.g., {"id": 1, "name": "Jane"}
Example 1: Accessing Nested Data
If you receive the following JSON:
{ "user": { "profile": { "firstName": "Sam", "lastName": "Lee" } } }You would reference the first name as {{ $json.user.profile.firstName }}.
Example 2: Array Data
If you have an array of emails:
["a@example.com", "b@example.com"]You access the first email as {{ $json.emails[0] }}.
Data Manipulation with Functions
Working with real-world data means transforming, cleaning, and extracting value from it. N8N offers a wide range of built-in functions,especially within its expression editor,that let you manipulate strings, numbers, arrays, and dates. You’ll use dot notation to chain these functions (e.g., $json.name.toLowerCase()).
The result panel gives you instant feedback, so you can experiment and see what your expressions return.
String Functions: Transforming and Extracting Text
Let’s dig into the most useful string functions, with practical examples:
- includes(substring): Checks if a string contains a substring.
Example 1: $json.subject.includes("invoice") , Does the subject line mention "invoice"?
Example 2: $json.email.includes("@company.com") , Is the email from your company? - split(delimiter): Turns a string into an array based on a delimiter.
Example 1: $json.tags.split(",") , Turns "red,blue,green" into ["red", "blue", "green"].
Example 2: $json.text.split("\n") , Splits text into an array of lines. - startsWith(substring): Checks if a string begins with a substring.
Example 1: $json.filename.startsWith("report_") , Is this a report file?
Example 2: $json.url.startsWith("https://") , Is the URL secure? - endsWith(substring): Checks if a string ends with a substring.
Example 1: $json.filename.endsWith(".pdf") , Is this a PDF?
Example 2: $json.email.endsWith("@gmail.com") , Is this a Gmail address? - replaceAll(pattern, replacement): Replaces every occurrence of a pattern in a string.
Example 1: $json.text.replaceAll("-", " ") , Replace dashes with spaces.
Example 2: $json.text.replaceAll(/\d{4}-\d{2}-\d{2}/g, "[DATE]") , Mask dates in text. - length: Returns the number of characters.
Example 1: $json.message.length , Check if a message is too long.
Example 2: $json.text.length , Calculate SMS charge based on length. - hash(algorithm): Hashes a string for secure storage.
Example 1: $json.password.hash("SHA256") , Hash a password before saving.
Example 2: $json.apiKey.hash("MD5") , Hash an API key for logging. - quote(mark): Wraps a string in quotes, escaping internal quotes.
Example 1: $json.text.quote('"') , Prepare text for SQL.
Example 2: $json.message.quote("'") , Prepare message for JSON. - removeMarkdown(): Removes Markdown formatting.
Example 1: $json.body.removeMarkdown() , Clean AI output before sending.
Example 2: $json.comments.removeMarkdown() , Clean user comments for display. - slice(startIndex, endIndex): Extracts a substring.
Example 1: $json.text.slice(0, 50) , Get the first 50 characters.
Example 2: $json.code.slice(-4) , Get the last 4 digits. - substring(startIndex, endIndex): Similar to slice.
Example 1: $json.name.substring(0, 1) , First character (initial).
Example 2: $json.id.substring(2, 6) , Middle digits. - trim(): Removes leading/trailing whitespace.
Example 1: $json.input.trim() , Clean user input.
Example 2: $json.title.trim() , Sanitize data before saving. - urlEncode() and urlDecode(): For URLs.
Example 1: $json.searchTerm.urlEncode() , Create search URLs.
Example 2: $json.encodedUrl.urlDecode() , Read incoming data. - indexOf(substring): Find the first occurrence.
Example 1: $json.text.indexOf("error") , Where is the word "error"?
Example 2: $json.email.indexOf("@") , Validate email format. - lastIndexOf(substring): Find the last occurrence.
Example 1: $json.text.lastIndexOf(".") , Find the last sentence end.
Example 2: $json.path.lastIndexOf("/") , Extract filename from a path. - match(regex): Find patterns using regular expressions.
Example 1: $json.text.match(/[A-Z]{2}\d{4}/g) , Find codes like "AB1234".
Example 2: $json.email.match(/@(\w+)\./) , Extract email provider. - search(regex): Returns the index of the first match.
Example 1: $json.text.search(/\d{2}:\d{2}/) , Find time in text.
Example 2: $json.body.search(/urgent/i) , Find "urgent" regardless of case. - Case Functions: toLowerCase(), toSentenceCase(), toSnakeCase(), toTitleCase(), toUpperCase() , Change the casing of text.
Example 1: $json.name.toTitleCase() , Present names nicely.
Example 2: $json.label.toSnakeCase() , Prepare keys for code. - parseJSON(): Converts a string to a JSON object.
Example 1: $json.rawData.parseJSON() , Parse API response.
Example 2: $json.config.parseJSON() , Read settings from a string. - toDatetime(): Converts a string to a datetime object.
Example 1: $json.dateString.toDatetime() , Prepare for date math.
Example 2: $json.timestamp.toDatetime() , Convert Unix time. - toNumber(): Converts a string to a number.
Example 1: $json.amount.toNumber() , Prepare for calculations.
Example 2: $json.price.toNumber().round(2) , Format to 2 decimals.
Tips for Using String Functions:
- Always check if your variable is in the expected format (string, number, etc.) before applying functions.
- Use match() and regex when you need to extract complex patterns, such as order numbers, dates, or hashtags.
- Use trim(), replaceAll(), and toLowerCase() to standardize and clean inputs before processing.
Number Functions: Calculations and Formatting
Numbers are everywhere,calculations, IDs, timestamps, scores. N8N gives you a toolkit for working with numbers:
- round(decimalPlaces): Rounds to a specified decimal place.
Example 1: $json.score.round(0) , Round to the nearest integer.
Example 2: $json.total.round(2) , Format price to two decimals. - floor(): Rounds down.
Example 1: $json.amount.floor() , Ignore cents.
Example 2: $json.hours.floor() , Whole hours worked. - ceil(): Rounds up.
Example 1: $json.items.ceil() , Always round item count up for packaging.
Example 2: $json.days.ceil() , Calculate minimum rental days. - abs(): Absolute value.
Example 1: $json.balance.abs() , Show debt as positive.
Example 2: $json.change.abs() , Ignore direction of change. - format(locale): Locale formatting (thousands, decimals, currency).
Example 1: $json.amount.format('en-US') , $1,234.56
Example 2: $json.total.format('de-DE') , 1.234,56 € - isEven(), isOdd(), isInteger(): Validate properties.
Example 1: $json.count.isEven() , Even number of records?
Example 2: $json.value.isInteger() , Is this value whole? - toBoolean(): Convert to boolean (0 = false, other = true).
Example 1: $json.flag.toBoolean() , Use in conditionals.
Example 2: $json.score.toBoolean() , Is score nonzero? - toDatetime(): Convert Unix timestamp to datetime.
Example 1: $json.timestamp.toDatetime() , Convert to readable date.
Example 2: $json.expiry.toDatetime() , Check if expired. - toLocaleString(locale): Localized string formatting.
Example 1: $json.amount.toLocaleString('fr-FR') , French number formatting.
Example 2: $json.price.toLocaleString('en-GB') , £1,000.00 - toString(): Convert number to string.
Example 1: $json.id.toString() , Prepare for concatenation.
Example 2: $json.amount.toString() , Build dynamic messages.
Tips for Number Functions:
- Always check number type when converting from string.
- Use format() and toLocaleString() for user-facing displays.
- abs() and rounding functions are useful for financial and scoring applications.
Array Functions: Managing Lists and Collections
Arrays let you handle multiple items,emails, records, products, whatever your workflow needs. Here’s how to manipulate arrays in N8N:
- length: Number of elements.
Example 1: $json.items.length , Count emails in inbox.
Example 2: $json.orders.length , Number of new orders. - last / first: Get last or first element.
Example 1: $json.list.first() , Get the earliest date.
Example 2: $json.results.last() , Last search result. - includes(element): Checks if element exists.
Example 1: $json.roles.includes("admin") , Is user an admin?
Example 2: $json.tags.includes("urgent") , Is this task urgent? - append(element): Add to the end.
Example 1: $json.list.append("new") , Add a new tag.
Example 2: $json.emails.append("c@example.com") , Add a recipient. - chunk(size): Split into batches.
Example 1: $json.records.chunk(100) , For batch processing.
Example 2: $json.items.chunk(10) , For API rate limits. - compact(): Remove null/empty.
Example 1: $json.data.compact() , Clean up entries.
Example 2: $json.arr.compact() , Remove empty tags. - concat(array): Merge arrays.
Example 1: $json.a.concat($json.b) , Merge two lists.
Example 2: $json.list.concat(["extra"]) , Add more items. - difference(array): What’s in A but not B.
Example 1: $json.newContacts.difference($json.existingContacts) , Find new subscribers.
Example 2: $json.allIds.difference($json.usedIds) , Find unused IDs. - intersection(array): Common elements in both arrays.
Example 1: $json.tags.intersection($json.keywords) , Find matching tags.
Example 2: $json.users.intersection($json.admins) , Find admin users. - find(condition): Find first element matching condition.
Example 1: $json.orders.find(order => order.status === "pending") , First pending order.
Example 2: $json.users.find(user => user.email === "bob@example.com") , Find Bob’s info. - indexOf(element): Index of first occurrence.
Example 1: $json.list.indexOf("apple") , Find "apple" in shopping list.
Example 2: $json.responses.indexOf(404) , Index of first error. - lastIndexOf(element): Index of last occurrence.
Example 1: $json.log.lastIndexOf("disconnect") , Last disconnect event.
Example 2: $json.states.lastIndexOf("open") , Last open state. - join(separator): Merge array into string.
Example 1: $json.tags.join(", ") , Produce "red, blue, green".
Example 2: $json.names.join(" | ") , Create a display list. - isEmpty(), isNotEmpty(): Check if array is empty.
Example 1: $json.items.isEmpty() , No items? Alert user.
Example 2: $json.records.isNotEmpty() , Proceed if data exists. - map(function): Apply function to each item.
Example 1: $json.scores.map(score => score * 2) , Double the scores.
Example 2: $json.emails.map(email => email.toLowerCase()) , Standardize emails. - reduce(function): Aggregate to a single value.
Example 1: $json.numbers.reduce((sum, n) => sum + n, 0) , Total sum.
Example 2: $json.strings.reduce((a, b) => a + ", " + b) , Concatenate items. - remove(index, count): Remove elements.
Example 1: $json.list.remove(0, 1) , Remove the first item.
Example 2: $json.queue.remove(-1, 1) , Remove last item. - replace(index, count, elements): Replace elements.
Example 1: $json.arr.replace(2, 1, ["new"]) , Replace third item.
Example 2: $json.tasks.replace(0, 2, ["updated"]) , Replace first two tasks. - slice(startIndex, endIndex): Extract subarray.
Example 1: $json.items.slice(0, 5) , First 5 items.
Example 2: $json.logs.slice(-10) , Last 10 logs. - splice(startIndex, deleteCount, itemsToAdd): Add/remove/replace.
Example 1: $json.arr.splice(1, 2, ["a", "b"]) , Replace two items at index 1.
Example 2: $json.data.splice(3, 0, ["inserted"]) , Insert at position 3. - unique(): Remove duplicates.
Example 1: $json.values.unique() , Unique customer IDs.
Example 2: $json.tags.unique() , Unique tags for analytics. - union(array): Combine arrays, only unique elements.
Example 1: $json.a.union($json.b) , Merge two user lists.
Example 2: $json.setA.union($json.setB) , Unique elements from both sets. - filter(condition): Items matching a condition.
Example 1: $json.orders.filter(order => order.status === "shipped") , Only shipped orders.
Example 2: $json.users.filter(user => user.active) , Only active users.
Tips for Array Functions:
- Use map(), filter(), and reduce() for powerful data transformations.
- chunk() and split into batches are essential for working with large datasets or API rate limits.
- Keep arrays clean with compact() and unique() to avoid errors downstream.
Date and Time Functions: Working with Datetime
Dates and times are tricky, but N8N’s datetime functions (using the Luxon library) make them manageable. Here’s what you can do:
- format(token): Format datetime as string with custom pattern.
Example 1: $json.date.format("yyyy-MM-dd") , “2023-05-12”
Example 2: $json.datetime.format("cccc") , “Tuesday” (day of week) - minus(amount, unit): Subtract time.
Example 1: $json.expiry.minus(7, "days") , Date one week earlier.
Example 2: $json.start.minus(2, "hours") , Two hours before event. - plus(amount, unit): Add time.
Example 1: $json.due.plus(3, "days") , Deadline three days later.
Example 2: $json.sent.plus(1, "week") , Schedule follow-up for next week. - diff(datetime, unit): Difference between two dates.
Example 1: $json.end.diff($json.start, "hours") , Event duration in hours.
Example 2: $json.now.diff($json.due, "days") , Days overdue. - extract(unit): Get year, month, day, etc.
Example 1: $json.date.extract("month") , Month number.
Example 2: $json.date.extract("weekday") , Day of week. - startOf(unit): Get start of month/year/etc.
Example 1: $json.date.startOf("month") , First day of month.
Example 2: $json.time.startOf("hour") , Top of the hour. - endOf(unit): Get end of period.
Example 1: $json.date.endOf("week") , Sunday of the week.
Example 2: $json.period.endOf("year") , December 31st. - zone: Get timezone.
Example 1: $json.event.zone , Display in local time.
Example 2: $json.timestamp.zone , Use for scheduling globally. - isWeekend(), isLeapYear(): Check special dates.
Example 1: $json.date.isWeekend() , Don’t schedule work on weekends.
Example 2: $json.date.isLeapYear() , Special logic for leap years.
Tips for Datetime Functions:
- Use format() to make dates human-friendly in emails or reports.
- plus() and minus() power scheduling and reminders.
- Always consider time zones with zone to avoid confusion in global workflows.
Workflow Control Nodes: Logic and Branching
These nodes let you control the flow of data and decisions in your workflows. Here’s how each one works, with practical insight:
- If Node: Branches workflow based on a condition.
Example 1: If order total > $100, send VIP email; else, send standard email.
Example 2: If email subject includes “urgent”, escalate to manager. - Filter Node: Passes through only items matching a criterion.
Example 1: Filter out emails not from @company.com.
Example 2: Only pass tasks with status “open”. - Merge Node: Combines data from two branches.
Example 1: Merge a list of orders with a list of customers.
Example 2: Combine results from two APIs. - Split into Batches Node: Breaks a large array into smaller groups for processing.
Example 1: Send emails in batches of 50 to avoid spam filters.
Example 2: Update database records in chunks of 100 for better performance.
Best Practices for Workflow Logic:
- Use If and Filter nodes to keep workflows efficient,don’t process data that doesn’t need it.
- Merge and Split into Batches nodes are essential for handling complex, multi-step automations, especially where APIs or services have limits.
Practical Examples and Use Cases
Let’s bring these tools together with real-world scenarios:
- Date Customization:
Transform machine dates into natural language. Example: Convert “2023-05-12” to “Friday”. Use format("cccc") for day of week, or format("dd LLL yyyy") for readable dates.
Example 1: Send a reminder: “Your appointment is on {{ $json.date.format('cccc, dd LLLL') }}.”
Example 2: Calculate follow-up deadlines based on submission date: $json.submitted.plus(3, "days").format("yyyy-MM-dd"). - Personalized Emails:
Use variables to tailor content.
Example 1: “Hi {{ $json.firstName }}, your order {{ $json.orderId }} is ready.”
Example 2: “Hello {{ $json.fullName }}, here’s your summary: {{ $json.summary }}.” - Data Extraction and Processing:
Extract sections from large text sources using split().
Example 1: Split incoming HARO email by “====” to get individual stories.
Example 2: Parse CSV content by split("\n") and then split(",") for each line. - Looping and Iteration:
Process each item in an array one by one using the Split Out node.
Example 1: For each extracted story, send it to an AI agent for summary.
Example 2: For each email in a list, send a personalized message. - Conditional Logic:
Use If/Else and Filter nodes for business rules.
Example 1: If the sender is “CEO”, set priority to high.
Example 2: If the name is “Alice”, set prize amount to $100; else, $50. - Drafting Emails:
Populate Gmail drafts with processed data.
Example 1: Draft an email for each new lead with their custom details.
Example 2: Generate daily reports and send as attachments.
Self-Hosting N8N: Methods, Pros & Cons
Sometimes, you want control over your workflows, lower costs, or privacy guarantees. That’s where self-hosting comes in,running N8N on your own infrastructure instead of a cloud provider.
Let’s walk through the main self-hosting options, with pros, cons, and best-fit scenarios:
- Render:
An easy cloud deployment platform. You can deploy the official N8N Docker image with a few clicks.
How it works: Sign up, select the Docker image, configure environment, deploy.
Pros: Simple, no server management, free tier for testing.
Cons: Free tier spins down after inactivity; paid tiers for always-on.
Best for: Beginners, quick prototypes, side projects, small businesses needing a hassle-free cloud setup.
Example 1: Set up your own N8N instance to automate business emails with full control.
Example 2: Deploy a client’s workflow for privacy-sensitive data without managing servers. - Railway:
Similar to Render, but requires GitHub integration.
How it works: Sign up with GitHub, deploy “n8n with workers” template (includes Postgres and Redis).
Pros: Scalable, easy to link with other services, supports background jobs.
Cons: Requires a GitHub account, some learning curve.
Best for: Teams, technical users, automations needing database or more scale.
Example 1: Deploy a workflow that processes thousands of records per day.
Example 2: Use Railway for a production SaaS automation offering. - Own Computer using Docker:
Install and run N8N locally in Docker containers.
How it works: Install Docker Desktop, pull N8N image, run with commands.
Pros: Maximum control, no hosting fees, full access to files.
Cons: Requires Docker and basic server skills, not ideal for always-on production unless you have server infrastructure.
Best for: Developers, privacy-focused industries (healthcare, legal, finance), high-volume internal use.
Example 1: Build and test workflows locally before deploying to the cloud.
Example 2: Run in a hospital network where data can never leave the premises. - Pipedream:
Another cloud option, easier for some users.
How it works: Connect accounts, deploy N8N as a workflow project.
Pros: User-friendly, quick setup.
Cons: Can be more expensive at scale, may not have same flexibility.
Best for: Quick experiments, low-volume workflows, non-technical users.
Example 1: Test an idea before committing to a larger deployment.
Example 2: Automate small business tasks without investing in infrastructure.
Why Self-Host?
- Full control over data,ideal for sensitive or regulated industries.
- Cost savings when running many workflows (cloud costs scale quickly).
- No vendor lock-in,move, export, or customize as you wish.
Tip: For simple needs and low volume, cloud N8N is fine. For privacy, compliance, or high usage, self-host.
Comparison with Other Automation Platforms
It’s natural to ask: why N8N over tools like Make.com?
Pricing: Make.com can be cheaper for a handful of operations, but costs rise fast with lots of loops, data, or complexity. N8N’s self-hosted option is flat-cost (your hosting), so you can scale without surprise bills.
Complexity: N8N is more flexible and extensible for advanced use (custom scripts, AI agents, etc.).
Example 1: If you’re running thousands of automations per day, N8N’s costs are predictable.
Example 2: If you need to integrate a custom AI workflow, N8N’s open system gives you more control.
Building and Selling AI Automations + Agents
Here’s how you combine everything you’ve learned to create, package, and sell automations and AI agents.
- Step 1: Identify a Pain Point or Opportunity
Talk to clients, colleagues, or observe your own repetitive tasks. Look for processes involving lots of manual work, data entry, or where AI could add value (summarization, classification, etc.).
Example 1: Automate lead qualification with AI scoring.
Example 2: Summarize daily emails and send a single digest. - Step 2: Map the Workflow Visually
List the inputs, transformations, decisions, and outputs. Then, drag nodes into N8N and connect them. Use the nodes and functions covered above.
Example 1: Input: Email → AI Summarize Node → Filter If “CEO” → Slack Alert.
Example 2: Webhook → Validate Input → AI Categorize → Update CRM. - Step 3: Use AI Nodes and Data Manipulation
Feed clean, well-structured data to your AI models. Use string and array functions to prepare prompts.
Example 1: Use split() to break up text for AI summarization.
Example 2: Use map() to process a batch of items in parallel. - Step 4: Control Logic and Error Handling
Add If and Filter nodes to handle exceptions, edge cases, or alternate flows.
Example 1: If AI confidence is low, escalate for manual review.
Example 2: If API rate limit is hit, use Split into Batches to throttle. - Step 5: Test, Iterate, and Package
Use N8N’s test and result panels. Once stable, document the workflow, export as a template, and package for clients.
Example 1: Offer a “Daily Digest” workflow as a productized service.
Example 2: Sell custom AI-powered lead qualification to agencies.
Best Practices for Selling Automations:
- Focus on business value, not just technical features.
- Offer support and updates.
- Provide clear documentation and instructions for non-technical users.
- Consider hosting for clients (using Render/Railway) or providing deployment guides for self-hosting.
Advanced Tips: Regular Expressions, Validation, and Security
To push your automations further:
- Regular Expressions (Regex): Use match() and search() for complex pattern extraction (order numbers, emails, etc.). Regex101.com is a great place to build and test your patterns. AI tools can even generate regex for you.
Example 1: Extract phone numbers from email body.
Example 2: Mask sensitive info before storing. - Validation Functions: Use isEmpty(), isNotEmpty(), isInteger(), etc., to avoid errors and ensure data quality.
Example 1: Only send emails if recipient field is not empty.
Example 2: Validate numbers before calculation. - Security: Never store plain text passwords. Use hash() to store hashes instead. Sanitize all input data, especially when interacting with databases or external systems.
Example 1: Hash user passwords before adding to database.
Example 2: Use quote() to escape user input for SQL queries.
Frequently Asked Questions (FAQ) and Glossary
Q: What’s the format for referencing a variable in N8N?
A: {{ $json.variableName }} or $json.variableName within expressions.
Q: How do I format a datetime in N8N?
A: Use format() with tokens. Example: $json.date.format("yyyy-MM-dd")
Q: What’s the difference between indexOf and lastIndexOf?
A: indexOf returns the index of the first occurrence; lastIndexOf returns the last occurrence.
Q: What is self-hosting?
A: Running N8N on your own server or local machine for privacy, control, or cost reasons.
Glossary Highlights:
- Node: A step in your workflow.
- Workflow: Connected nodes automating a process.
- Array: An ordered list of items.
- Object: A collection of key-value pairs.
- JSON: The data format N8N uses internally.
- If Node: Logic that branches based on a condition.
- Filter Node: Passes only certain items.
- Merge Node: Combines data streams.
- Split into Batches: Breaks data up for processing.
- Self-Hosting: Running N8N on your infrastructure.
- Regex: Pattern matching for text.
- Hashing: Securely storing sensitive values.
Conclusion: Mastering N8N for AI Automations and Business Growth
By now, you understand the foundations of N8N: nodes, workflows, variables, and data types. You’ve learned to manipulate strings, numbers, arrays, and dates with dozens of built-in functions,plus how to use control nodes for branching, filtering, and batching data. You can connect to AI, extract and process information, and deploy robust workflows that automate real business tasks.
You also know your hosting options,cloud for simplicity, self-hosted for control and scale,and how to choose the right approach for your needs. You’ve seen how to package, document, and sell your automations or AI agents, turning technical skill into business value.
The real power comes from applying these skills: find the bottlenecks in your work or your clients’ work, build automations that save hours, and create AI agents that do the heavy lifting. Every manual task is a potential workflow. Every repetitive process is an opportunity to automate and scale.
Keep experimenting, exploring, and delivering value. The automations you build today are the assets you’ll sell or rely on tomorrow.
Frequently Asked Questions
This FAQ section is designed to answer the most common and practical questions about building and selling AI automations and agents using n8n. Whether you're just starting out or looking to refine advanced automations, these questions cover everything from core concepts and practical workflow design to troubleshooting and business implementation. Use this as a resource to clarify technical details, discover best practices, and get insights on how to leverage n8n for real-world business automation.
What are the primary data types used in n8n expressions and how are they formatted?
n8n expressions use several key data types:
Strings are sequences of characters, enclosed in quotes (e.g., "Hello World"). Numbers can be integers or decimals and don’t require quotes (e.g., 123 or 3.14). If you put a number in quotes, it’s handled as a string, though n8n can often convert types as needed. Booleans represent true or false. Arrays are ordered lists, enclosed in square brackets ([item1, item2]), and Objects are key-value pairs in curly braces ({"key": "value"}). Arrays and objects can be nested within each other, supporting complex data structures.
How are variables accessed and manipulated within n8n workflows?
Variables are accessed using a specific syntax: {{$json.variableName}}.
$json refers to the data object, and .variableName points to a specific key. For nested data, use dot notation (e.g., $json.user.first_name). The expression editor lets you browse and build these expressions interactively. You can also chain functions using dot notation (e.g., $json.start_time.toDateTime().format('E')) to manipulate values quickly.
What are some common string manipulation functions available in n8n expressions?
n8n offers a variety of string manipulation functions:
includes(substring) checks if a string contains a substring. split(delimiter) divides a string into an array. startsWith and endsWith check prefixes and suffixes. replaceAll swaps all instances of a pattern. length returns the character count. slice extracts a section. trim removes whitespace from both ends. You also have casing functions (toLowerCase, toUpperCase, etc.), removeMarkdown, quote, URLencode, and URLdecode. These functions make it easy to clean, transform, and prepare text for automations.
How can arrays be manipulated using n8n functions?
n8n provides extensive functions for arrays:
length gives the item count. first() and last() return the first and last items. includes checks if an element exists. join(separator) converts an array to a string. chunk splits arrays into groups. compact removes empty values. concat merges arrays. difference and intersection compare arrays. find retrieves the first matching element. indexOf finds an item’s index. isEmpty checks for empty arrays. splice modifies content, union merges unique values, and unique removes duplicates. These functions are essential for processing lists, such as filtering or batching customer records.
What are some essential control flow nodes in n8n?
Control flow nodes guide how data moves and is processed:
If splits the workflow based on a condition. Filter removes items not meeting a condition. Merge combines data from branches. Split into Batches divides large sets for manageable processing. Split Out turns arrays into individual items for separate handling. These nodes are crucial for creating flexible, logic-driven workflows that adapt to your business process.
How does n8n handle date and time manipulation?
n8n uses the Luxon library for dates and times:
Convert strings or numbers to datetime objects with .toDateTime(). Then, use format to produce custom date strings (e.g., 'yyyy-MM-dd'). plus and minus add or subtract time units. diff calculates differences. extract retrieves components like year or hour. startOf and endOf round to periods. toLocalString formats per locale. zone shows time zone. isWeekend and isLeapYear provide quick checks. These tools help automate scheduling, reporting, and reminders.
What is JSON and how is it used in n8n?
JSON (JavaScript Object Notation) is the standard for structured data in n8n:
It’s readable and easy to manipulate. Data between nodes is passed as JSON objects, and you access values using dot notation. Functions like parseJSON turn string data into usable objects, and quote helps format JSON strings. Understanding JSON is key to working effectively with APIs, databases, and automations.
What are the different ways to self-host n8n?
Several self-hosting options are available:
Render and Railway are managed platforms that let you deploy n8n with minimal setup, often using Docker images. You can also run n8n locally or on your own server using Docker Desktop, giving you full control. It’s also possible to host on major cloud providers (AWS, Google Cloud, Azure) by creating your own infrastructure. Each approach offers different balances of control, cost, and maintenance, so choose based on your business needs and technical comfort.
What is the typical format for referencing a variable in n8n using dot notation?
The standard format is: {{$json.variableName}}.
This tells n8n to pull the variableName from the JSON data of the current item. For nested properties, like a user's first name inside a user object, you’d use {{$json.user.first_name}}. This syntax is consistent throughout n8n and is fundamental for pulling dynamic values into expressions and nodes.
How is the format function used with datetime variables?
The format function customizes how datetime values are displayed:
Once you have a datetime object (e.g., via .toDateTime()), you can apply .format('yyyy-MM-dd') or other tokens for custom layouts. For example, to show only the month and year, you might use .format('MM/yyyy'). This is useful for reporting, labeling files, or sending human-friendly messages.
What does the split function do when used with strings?
split divides a string into an array based on a delimiter:
For example, "apple,banana,cherry".split(',') returns ["apple", "banana", "cherry"]. This is commonly used to take a comma-separated list and process each item individually in a workflow. It’s especially handy for transforming data from forms or CSV files into actionable lists.
How does the includes function work on a string or an array?
includes checks for the presence of a value:
On a string, it returns true if the substring exists (e.g., "hello world".includes("world") is true). On an array, it returns true if the element is present (["a", "b"].includes("a") is true). This is ideal for filtering or validating data, like checking if a customer’s email is in a blocklist or if a message contains certain keywords.
Certification
About the Certification
Become certified in n8n Automation and AI Workflows,design, deploy, and monetize automated solutions, integrate diverse apps, and optimize business processes without advanced coding. Demonstrate practical, real-world automation expertise.
Official Certification
Upon successful completion of the "Certification in Building, Deploying, and Monetizing AI Workflows with n8n", you will receive a verifiable digital certificate. This certificate demonstrates your expertise in the subject matter covered in this course.
Benefits of Certification
- Enhance your professional credibility and stand out in the job market.
- Validate your skills and knowledge in cutting-edge AI technologies.
- Unlock new career opportunities in the rapidly growing AI field.
- Share your achievement on your resume, LinkedIn, and other professional platforms.
How to complete your certification successfully?
To earn your certification, you’ll need to complete all video lessons, study the guide carefully, and review the FAQ. After that, you’ll be prepared to pass the certification requirements.
Join 20,000+ Professionals, Using AI to transform their Careers
Join professionals who didn’t just adapt, they thrived. You can too, with AI training designed for your job.