Skip to main content

Sales advisor chat

A chat agent on the quote and order editor that gives short, practical sales advice on the quote you are working on. It remembers the conversation and looks at the company's recent orders, so its tips reflect what the customer actually buys.

Runs: Embedded in Propeller · Trigger: Chat · Difficulty: Easy

What you need​

  • An n8n account. See Set up n8n.
  • A Propeller API key.
  • An OpenAI account for the chat model.
  • Owner access on the Configuration role to create the agent.

How it works​

Propeller sends your chat message together with the page you are on. The workflow gives the AI model a short summary of it: for a quote or order the totals and at most 50 lines with price, cost, margin and stock. For a known company it adds the number of orders in the last 90 days and the top products of the latest 10 orders. An AI model replies with concise sales advice a rep can act on.

Follow-up questions work because the agent keeps a memory per conversation. Each conversation has its own memory.

Install it​

  1. In n8n, import the downloaded JSON as a new workflow.
  2. Connect your OpenAI account on the OpenAI Chat Model node.
  3. Create a header auth credential with your Propeller API key and select it on the Fetch Company History node.
  4. On the Webhook node, set a basic auth credential (a username and password you choose) and copy the production URL.
  5. Activate the workflow.
  6. Go to Admin > Agents and create an agent with Trigger Chat and Interaction Mode Multi Turn. Under Types, pick SALES_HUB_QUOTE_EDITOR, SALES_HUB_ORDER_EDITOR, SALES_HUB_QUOTE_REQUEST_EDITOR, SALES_HUB_COMPANY and BACKOFFICE_PRODUCTS. Paste the webhook URL and the same basic auth values. See AI Agents.
  7. Open a quote, click the Workflows button, select the agent and ask for advice.
Filling in your API key

In n8n, create a credential of type Header Auth and fill in its two fields exactly like this:

FieldWhat to fill in
NameapiKey
ValueYour Propeller API key

Name is not a title you pick yourself. It has to say exactly apiKey, otherwise the workflow cannot sign in. See Set up n8n for the full steps.

Placement matters

An agent type is the page where the agent appears. Stick to the types listed in the install steps: the workflow depends on the data that page sends along, so placing the agent on other pages may not work.

Make it yours​

  • Tone and language: the system prompt in the AI Agent node controls the advice style and the answer length. It answers in the language of your message, and in English when the message is only a SKU, a code or a number.
  • Model: pick a different model in the OpenAI Chat Model node.
  • What the model sees: MAX_LINES_IN_PROMPT, HISTORY_DAYS, ORDER_STATUSES and LINES_FROM_LAST in the Settings node.

Limits​

The chat memory uses n8n's Simple Memory, which does not work when n8n runs in queue mode. In tests an answer took 5 to 14 seconds; the agent waits 30 seconds by default.

Use it outside n8n​

Copy the JSON into an AI assistant and follow Adjust a workflow with an AI assistant.

Good to know

The workflows and agents in the Agent Hub are free to use and adapt. They are examples, not supported product features, so test them in a staging environment and check the results before using them in production.