# How do you add an AI step to a Zapier, Make or n8n workflow?

Date: 2024-10-20 · Author: Robert Scales · https://guidetoartificialintelligence.com/en/learn/add-ai-step-zapier-make-n8n-workflow/

**Answer:** You place an OpenAI action between a trigger and the rest of your workflow, give it a clear prompt that uses fields from the trigger, and ask for output in a fixed shape so the next steps can use it. Zapier, Make and n8n all ship a ready-made OpenAI step, so the work is mostly in writing the prompt and mapping its answer to the right fields.

Automation tools like Zapier, Make and n8n follow simple rules: when something happens in one app (the **trigger**), do something in another (the **action**). That works well for tidy data, such as a form field copied into a spreadsheet. It struggles with messy human text. An email that says "Can you send the revised quote before Thursday? Also, the invoice address changed" contains two tasks and a deadline, but no rule can reliably pull them out.

An AI step fills that gap. It sits in the middle of the workflow, reads the messy text, and hands back something tidy that the ordinary steps can use. All three tools offer a ready-made OpenAI step, so you don't need to write code. You need an OpenAI API key (a secret password for the API, billed per use and separate from a ChatGPT subscription), a good prompt, and a plan for what the next step expects.

## The shape of every AI workflow

Think of it in four parts:

1. **Trigger:** a new email, form entry, support ticket or spreadsheet row.
2. **Filter:** a plain rule that decides whether the item deserves an AI call at all.
3. **AI step:** one focused job, with the trigger's fields placed into the prompt.
4. **Actions:** create a task, post a message, update a record, using the AI's answer.

The key decision is what the AI step returns. Free-form prose is fine if a human reads it next. If another step must use it, ask for separate, named pieces, such as a title, a due date and a priority, so each can go into its own field.

## A worked example in Zapier: email to summary to task

Goal: when a client email arrives with a "Clients" label in Gmail, create a task in your to-do app with a short summary, a due date if one is mentioned, and the sender's name.

**Step 1, trigger.** Choose Gmail and a trigger for new emails, limited to the "Clients" label. Run a test so Zapier loads a sample email you can map from.

**Step 2, filter.** Add a Filter step so the Zap only continues if the sender's address does not contain "noreply". Newsletters and receipts never reach the paid AI step.

**Step 3, AI step.** Add the ChatGPT app. Its actions include Conversation, Summarize Text, Classify Text and Extract Structured Data. Extract Structured Data suits this job, because it returns named values rather than one block of text. Describe the task and list the values you want:

```prompt
Read this client email and pull out the information for one follow-up task.
Email subject: {{Subject}}
Email body: {{Body Plain}}

task_title: an action starting with a verb, under 10 words
summary: two sentences on what the client wants
due_date: the deadline in YYYY-MM-DD format, or "none" if no date is given
priority: high if the email mentions urgency or a date within 3 days, otherwise normal
```

The parts in braces stand for fields you map from the Gmail step; Zapier shows them as clickable chips rather than typed text.

**Step 4, action.** Add your task app (Todoist, Asana, Trello or another) and choose its "create task" action. Map `task_title` to the title, `summary` plus the sender's name to the description, and `due_date` to the due date. Add a Path or Filter so that when `due_date` is "none" the field is simply left empty.

**Step 5, test.** Send yourself three emails: one with a clear deadline, one vague, one with two requests. Check that each produces a sensible task before turning the Zap on.

Here is an illustrative result from the first email:

| Field | Value |
|---|---|
| task_title | Send revised quote to Dupont Renovations |
| summary | The client wants the revised quote before Thursday. They also report a new invoice address. |
| due_date | 2024-10-24 |
| priority | high |

Notice the second request (the address change) is in the summary but not in its own task. If you want one task per request, ask the AI for a list and use a looping step, which is a good second project.

> **Try it:** Build the Zap with a test label, then forward five real emails from last week to it. Compare the tasks with what you would have written yourself, and rewrite one line of the prompt to fix the most common mistake.

## The same workflow in Make and n8n

**Make** calls a workflow a scenario and builds it on a visual canvas. Its OpenAI app has a "Create a Completion" module that sends a prompt or chat to GPT-style models. Place it after a Gmail module that watches for new emails and before your task app's module. To get separate fields, ask for JSON (a simple text format of named values) in your prompt, then add Make's JSON parsing module so each value can be mapped. As in Zapier, put a filter before the AI module so unwanted emails never cost you tokens.

**n8n** is a workflow tool that many technical users like for its flexibility. Its OpenAI node offers a "Message a Model" operation under Text. Connect it after a Gmail trigger node, use expressions to place the subject and body into the prompt, and ask for JSON output. If an operation you need is missing, n8n's HTTP Request node can call the OpenAI API directly with the same stored credential, which gives you every API option.

## Which steps should stay rule-based?

Keep anything with a definite right answer in plain rules. Filtering by sender, label or keyword, routing by a known field, date arithmetic, currency math and removing duplicates are all cheaper, faster and fully predictable as regular steps. An AI model can get them right most of the time, but "most of the time" is a poor standard for a calculation or an invoice.

Keep rules around anything that acts on the outside world. Let the AI draft, sort and summarize, but have a rule-based step, or a person, decide whether to send an email to a client, issue a refund or delete a record. A simple pattern is to save AI drafts to a folder or a "to review" list instead of sending them.

Use rules to check the AI's output too. Test that `due_date` really looks like a date, that `priority` is one of your allowed values, and that required fields aren't empty, and send anything unusual to a human. The AI handles the language; the rules handle everything that must always be true.

## Sources

- ChatGPT Integrations | Connect Your Apps with Zapier: https://zapier.com/apps/chatgpt/integrations
- OpenAI (ChatGPT, Whisper, DALL-E) Integration | Workflow Automation | Make: https://www.make.com/en/integrations/openai-gpt-3
- OpenAI node documentation: https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/
