Skip to content

Draft a reply with AI ​

Use the LLM node to have an AI model write text from your flow's data, such as a reply to a customer message, then pass that text to the next step. The same pattern works for summaries, translations and classifications.

This guide assumes your flow already has the message to reply to, for example from a form response.

1. Add the LLM step ​

  1. Click Add Step, open AI, choose LLM, then Text Chat.
  2. Choose a Model. The default is a good start.

2. Write the messages ​

Messages is the conversation you send to the model. Add two:

  1. A System message with standing instructions:

    You reply to customer enquiries for Example Corp. Be friendly and brief, at most 120 words. Don't promise refunds or dates. Sign off as "The Example team".

  2. A User message with this run's data. Type $ to insert values from earlier steps:

    Customer name: Current Trigger.name Their message: Current Trigger.message

    Write a reply.

Keep instructions in the System message and data in the User message. It makes the prompt easier to read and to change later.

3. Use the reply in the next step ​

The generated text is at this path in the LLM step's output:

response.choices[0].message.content

The $ list doesn't offer content yet, so type the full reference into the field:

$.<LLM step ID>.output.response.choices[0].message.content

To get the step ID, open the $ list and use the copy button next to the LLM step, then add the rest of the path.

For example, add Mail › Send Mail and set its body to that reference.

Get structured answers instead of text ​

When the next step needs specific values, such as a category to branch on, ask for JSON:

  1. Set Response Format to JSON Schema.

  2. In Schema Definition, describe the fields you want:

    json
    {
      "type": "object",
      "properties": {
        "category": { "type": "string", "enum": ["billing", "bug", "other"] },
        "reply": { "type": "string" }
      },
      "required": ["category", "reply"]
    }
  3. Mention the fields in your User message, for example "Classify the message and write a reply."

The parsed result is at response.choices[0].message.parsed_content, so the category is:

$.<LLM step ID>.output.response.choices[0].message.parsed_content.category

Use it in a Path condition to handle each category differently.

Tips ​

  • Temperature controls variety. Lower it, to about 0.2, for consistent, factual answers. Raise it for creative text.
  • Max Tokens caps the length of the reply (default 1000). If replies stop mid-sentence, raise it. response.choices[0].finish_reason is length when this happens.
  • Run the flow with a few real examples and read the replies in Executions before publishing. Small changes to the System message make a big difference.