MolKit logo
Tools

Step 6 of 10

Add the AI response step

Generate a concise, safe first-draft reply tailored to each lead's inquiry using a structured AI prompt.

Why this matters

The AI step is the core of this workflow, it replaces the human who would otherwise write each first reply. The quality of the output depends almost entirely on the quality of your prompt. A prompt that does not constrain the AI will produce confident-sounding replies with made-up pricing and impossible timelines. The prompt structure in this step prevents that.

Build instructions

Set up your OpenAI account and API key

  1. Step 1

    Go to platform.openai.com/signup. Sign up with your email. You will need to add a payment method, even a $5 credit is more than enough for hundreds of test runs with GPT-3.5-turbo.

  2. Step 2

    After logging in, click your account name in the top right → 'API keys'. Click '+ Create new secret key'. Give it a name like 'Zapier Lead Responder'. Copy the key immediately, you will not be able to view it again.

  3. Step 3

    Store the key somewhere safe (a password manager or your notes app). You will paste it into Zapier in the next sub-step.

Add the AI action step in Zapier

Zapier offers two options: 'AI by Zapier' (no OpenAI account needed, simpler) and 'OpenAI' (full control, uses your API key). For production use, use OpenAI directly.

  1. Step 1

    Click '+' to add a new step after your validation steps. Search for 'OpenAI (GPT-4, DALL-E, Whisper)'. Select it.

  2. Step 2

    Under 'Choose action event', select 'Send Prompt'. This sends a text prompt and returns the AI's response.

  3. Step 3

    Click 'Sign in to OpenAI'. In the API key field, paste the key you copied in the previous sub-step. Click 'Yes, continue'.

Write the prompt with structured constraints

Your prompt has four parts: role, context from the lead, output requirements, and forbidden content.

  1. Step 1

    In the 'User Message' field, paste this prompt template and replace the bracketed fields with dynamic values from your Zapier steps:

  2. Step 2

    ROLE: You are a professional customer response specialist. Write a first reply email body to an incoming lead inquiry.

  3. Step 3

    LEAD CONTEXT: Name: [Full Name from Formatter]. Inquiry Type: [Inquiry Type from trigger]. Message: [Truncated Message from Formatter].

  4. Step 4

    OUTPUT REQUIREMENTS: Write 3 short paragraphs. Paragraph 1: Personalized greeting acknowledging their specific inquiry type. Paragraph 2: One sentence confirming we received their message and will follow up. Paragraph 3: One clear next step or call to action. Total length: under 120 words.

  5. Step 5

    FORBIDDEN: Do not mention specific prices, timelines, guarantees, or any information not given in the lead context. Do not invent features or promises. If you are unsure about something, write that the team will follow up with details.

  6. Step 6

    Set the Model to 'gpt-3.5-turbo'. Under Max Tokens, type 300. This limits response length and cost.

Test and review the AI output

  1. Step 1

    Click 'Test step'. Zapier sends your prompt to OpenAI using the sample data from the trigger.

  2. Step 2

    Read the generated reply carefully. Check: Does it address the correct inquiry type? Is it under 120 words? Does it contain any made-up prices or timelines?

  3. Step 3

    If the output is too long, reduce Max Tokens to 200. If it ignores the inquiry type, rewrite Paragraph 1 instruction in your prompt to be more specific.

  4. Step 4

    Run the test 2-3 more times if you can: AI output can vary slightly. Confirm it is consistently safe across multiple runs.

Common mistakes

  • Writing the prompt as a single paragraph with no structure. An unstructured prompt produces unpredictable output. Always use explicit sections: ROLE, CONTEXT, OUTPUT FORMAT, FORBIDDEN.
  • Not setting Max Tokens. Without a token limit, OpenAI can generate 800-word essays that look absurd in an email reply. Set it to 200-300 for this use case.
  • Passing the raw trigger Message field (before truncation) to the AI. A 3000-word message inflates your prompt size, raises cost, and often causes the model to summarize instead of respond. Always use the truncated version from the Formatter step.
  • Using GPT-4 for this step without a cost estimate. GPT-4 costs about 20x more than GPT-3.5-turbo for the same prompt. Start with GPT-3.5-turbo, which is sufficient for structured email drafts.

Pro tips

  • Add the word 'concise' multiple times in your prompt, in the role definition, in the output requirements, and in the length constraint. Repetition is the most reliable way to enforce brevity in LLMs.
  • Test your prompt with an edge case: an Inquiry Type of 'Support' with a Message about a billing dispute. The output should acknowledge the inquiry without making any commitments. If it promises a refund, tighten the FORBIDDEN section.

Before you continue

The OpenAI step returns a reply draft that: addresses the lead's specific inquiry type, is under 150 words, does not mention pricing or timelines, and ends with a clear next step. Read it out loud, if it sounds like something you would be comfortable sending, you are ready to continue.

Step result

Each new lead now generates a personalized, constrained first-draft reply that is ready for delivery without human editing.