> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hiveku.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflow Recipe: AI-Generated Form Responses

> Automatically reply to contact form submissions with a personalized AI-generated message

A generic "Thanks, we got your message" auto-reply feels robotic. An AI-generated acknowledgement that reflects what the person actually asked about — within 60 seconds — establishes trust while your team prepares a real answer.

<Info>
  Before you start: you'll need a contact form on your site and your email service configured. See [Send Emails](/how-tos/send-emails).
</Info>

## The Flow at a Glance

<CardGroup cols={4}>
  <Card title="Form submit" icon="square-poll-vertical">
    Webhook trigger
  </Card>

  <Card title="AI reply" icon="wand-magic-sparkles">
    Generate personalized response
  </Card>

  <Card title="Email visitor" icon="envelope">
    Send within 60 seconds
  </Card>

  <Card title="Notify team" icon="slack">
    Slack ping for human follow-up
  </Card>
</CardGroup>

## Step 1: Create the Workflow

<Steps>
  <Step title="Open Workflows">
    Go to **Workflows > New Workflow**. Name it `Contact Form → AI Reply`.
  </Step>

  <Step title="Add a Webhook trigger">
    Click **Add Trigger > Webhook**. Copy the generated URL — you'll wire it to your contact form.
  </Step>
</Steps>

## Step 2: Generate the AI Response

<Steps>
  <Step title="Add an AI Generation action">
    Click **+ Add Action > AI Generation**.
  </Step>

  <Step title="Pick a model">
    **Hiveku Max** balances quality and cost nicely for short responses. Use **Hiveku Mini** if you want to cut cost further and the prompt is simple enough.
  </Step>

  <Step title="Write the prompt">
    ```
    A visitor named {{trigger.name}} submitted the contact form with this message:
    "{{trigger.message}}"

    Write a warm, professional acknowledgement email that:
    - Confirms we received their message
    - Briefly reflects what they asked about
    - Sets expectations for a proper response within 24 hours
    - Signs off as "The Acme team"
    - Stays under 120 words
    ```

    The reflection step is what makes it feel personal — the AI shows it actually read the message.
  </Step>
</Steps>

## Step 3: Send the Email

<Steps>
  <Step title="Add a Send Email action">
    Click **+ Add Action > Send Email**.
  </Step>

  <Step title="Configure the email">
    * **To:** `{{trigger.email}}`
    * **From:** `support@yoursite.com` (must be a verified sender)
    * **Subject:** `We got your message, {{trigger.name}}`
    * **Body:** `{{step2.output}}` (the AI-generated content from the previous step)
  </Step>
</Steps>

## Step 4: Notify Your Team

Don't let the AI reply be the only response — it's an acknowledgement, not a substitute for a human.

<Steps>
  <Step title="Add a Slack action">
    Click **+ Add Action > Slack Message**. Configure the target channel (e.g., `#inbound-leads`).
  </Step>

  <Step title="Compose the notification">
    ```json theme={null}
    {
      "text": "New contact form from {{trigger.name}} ({{trigger.email}}): {{trigger.message}}"
    }
    ```

    See [Slack Notifications](/how-tos/workflow-slack-notifications) for richer formatting with Block Kit.
  </Step>
</Steps>

## Step 5: Save and Enable

Click **Save**, toggle **Enabled**. Until the toggle is on, nothing fires.

## Step 6: Wire Your Form

How you connect the form to the trigger depends on how it's built:

<Tabs>
  <Tab title="Native Hiveku form">
    Open the form in the content editor. Under **Submission Settings**, paste the trigger URL into **POST to webhook**.
  </Tab>

  <Tab title="Custom code form">
    POST to the trigger URL from your submit handler:

    ```typescript theme={null}
    await fetch('https://workflows.hiveku.com/trigger/abc123', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ name, email, message }),
    });
    ```
  </Tab>

  <Tab title="Third-party form">
    Typeform, Tally, Jotform — all support webhooks. Paste the trigger URL in their webhook settings and map your field names.
  </Tab>
</Tabs>

## Guardrails for AI-Generated Replies

<Tip>
  Keep the AI tone authentic to your brand. Include voice guidelines directly in the prompt, or reference your [Brand Guide](/how-tos/brand-guide) so all AI output pulls consistent tone.
</Tip>

<Warning>
  Do not let AI responses make specific promises — pricing, delivery dates, legal or medical claims, SLA guarantees. Constrain the prompt with instructions like: *"If you don't know specific pricing, say 'our team will follow up with pricing details'"*. Position these as acknowledgements, not definitive answers.
</Warning>

## Cost Expectations

At typical form message lengths (50-200 words in, 80-120 words out):

* **Hiveku Mini:** roughly $0.0005-$0.002 per response
* **Hiveku Max:** roughly $0.001-$0.005 per response

For a business processing 1,000 form submissions per month, AI acknowledgements cost $1-$5.

## Verify It Worked

Submit your own form with a real-sounding message. Confirm:

1. The AI-generated email arrives in under 60 seconds
2. The email reflects what you actually wrote (not generic)
3. The Slack ping lands in the right channel
4. The email comes from your verified sender, not a default `noreply`
5. The reply doesn't include anything you didn't authorize (fake pricing, fake dates)

## Troubleshooting

<AccordionGroup>
  <Accordion title="AI response too generic">
    Improve the prompt. Add 2-3 examples of responses you've sent in the past ("Here are examples of our brand voice: ..."). Specify what *not* to do ("Don't use phrases like 'we value your business'"). Richer prompts produce less bland output.
  </Accordion>

  <Accordion title="AI includes made-up info">
    Add explicit constraints. Example: *"If the message asks about pricing, respond with 'Our team will send pricing details separately — our plans start at \$X/month'. Never invent specific prices."* When AI hallucinates, it's usually because the prompt left room for it.
  </Accordion>

  <Accordion title="Response takes too long">
    Use a faster model (Mini over Max), shorten the prompt, and remove unnecessary context. Under 5 seconds is a reasonable target for acknowledgement emails.
  </Accordion>

  <Accordion title="Emails end up in spam">
    Verify your sender domain in email settings (SPF, DKIM, DMARC records must be correct). For new sending addresses, warm them up by sending low volume to engaged recipients first. See [Dedicated Email IP](/how-tos/dedicated-email-ip) for high-volume use.
  </Accordion>

  <Accordion title="Workflow runs but email doesn't send">
    Check the **Runs** tab for the failing step. Common causes: invalid recipient email, unverified sender, quota exceeded. The error message in the run log tells you which.
  </Accordion>
</AccordionGroup>

## What's Next?

<CardGroup cols={2}>
  <Card title="Brand Guide" icon="palette" href="/how-tos/brand-guide">
    Keep all AI output on-brand with a single source of truth
  </Card>

  <Card title="Slack Notifications" icon="slack" href="/how-tos/workflow-slack-notifications">
    Richer Slack formatting with Block Kit
  </Card>
</CardGroup>
