Skip to content
Plain Help Center home
Plain Help Center home

AI Prompt Condition

  1. How it works

  2. When to use it

  3. What Plain sends in the context

  4. How to write good conditions

  5. Examples

  6. Common mistakes

How it works

The AI prompt condition evaluates your written condition against the thread context Plain provides (see What Plain sends in the context).

It then determines whether the thread should take the Yes branch or No branch in your workflow.

When to use it

Use the AI prompt condition when the decision depends mainly on the meaning of what was said in the thread (especially the message timeline).

Thread metadata, labels, and thread fields support that reasoning, they clarify or add structure, but they shouldn't replace checks you can express with standard conditions like Priority equals or Contains label.

For those rule-based checks, prefer standard conditions. The outcome stays predictable and consistent.

What Plain sends in the context

When an AI prompt condition runs, Plain builds the AI context from the items below. Use the same names and values when you refer to them in your prompt (see How to write good conditions).

Messages

  • Up to 600 most recent

  • Text

  • Timestamp (UTC)

  • Direction (one of INBOUND, OUTBOUND)

  • Actor type (one of customer, user, machineUser, system)

Thread metadata

  • Title

  • Description

  • Status (one of Needs first response, Needs next response, Investigating, Close the loop, Waiting for customer, Paused for later, Ignored, Done)

  • Priority (one of Urgent, High, Normal, Low)

  • Created at (UTC)

Customer

  • Full name

  • Email address (only for the Email channel)

Channel

  • Source (one of CHAT, EMAIL, API, SLACK, MS_TEAMS, DISCORD)

  • Name (channel name or support email as applicable)

Assignee

  • Primary assignee only

  • Full name

  • Type ( one of user , machineUser)

Attachments

  • Whether it has attachments ( yes / no)

Thread fields

  • Label (field name)

  • Value

Labels

  • Name

  • Description

How to write good conditions

Format: Match if / Don't match

Write your conditions using "Match if..." to describe what should take the Yes branch, and "Don't match if/for..." to clarify what should take the No branch.

Example

Match if the customer explicitly requests a refund. Don't match for general billing questions or payment issues without refund mentions.

Prompting tips

Say what "match" looks like.

Instead of..

Try...

The customer is not happy.

Match if the customer shows obvious signs of frustration (e.g. strong complaints, urgency, dissatisfaction with the product or support).

Escalation needed.

The customer asks to speak to a manager, legal, or security; or threatens to cancel, dispute, or go public.

It's about billing.

Match if the customer is asking about a charge, invoice, refund, or subscription price.

Use one main decision per condition

You can describe several aspects in the same condition, as long as they add up to one outcome: match or don't match for this step.

Avoid prompts that try to make several unrelated decisions at once (e.g. different routes for A vs B). Split those into separate condition steps. Very long conditions with many loosely related criteria are more likely to misfire.

Prefer positive, checkable criteria

Instead of...

Try...

Don’t match if it’s just a greeting.

Match only if the customer asks a concrete question or requests an action, not if the message is only a greeting or thanks.

Not spam.

Match if the message is a genuine support request about our product or account (not unsolicited sales or unrelated cold outreach).

Be explicit when using multiple criteria

  • Match only if all of these are true: …

  • Match if any of these is true: …

Use the right values when you refer to context fields

When you mention available fields, use the same values Plain includes in the context (see Plain sends in the context). Examples:

  • user or machineUser (not human or bot) for assignee type

  • MS_TEAMS (not Microsoft Teams) for channel type

Exact casing is not required, what matters is the correct value.

Example:

Match if priority is Urgent and the assignee has type machineUser and the latest inbound customer message asks to speak to a human.

Examples

Simple intent detection

Match if the customer is asking to schedule a call or demo (calendar link, "book time", "when are you available").Don't match for async questions with no scheduling intent.

Checking resolution

Match if the latest customer message is only a thank you or acknowledgment with no new question.

GDPR deletion request

Match if the customer explicitly asks to delete their account or data under privacy/GDPR. Don't match if they only want to export data or cancel a subscription without deletion.

Combining metadata + content

Match if the thread has the Billing label and the customer asks about sales tax, VAT, or invoice line items for a specific charge. Don't match for generic pricing questions.

Multi-criteria

Match only if all of the following are true:

(1) The customer reports unauthorized access, data exposure, or a breach

(2) Priority is Urgent

(3) The primary assignee has type machineUser

Common mistakes

Problem

Example

Solution

Too broad, many unrelated outcomes

Match for refunds, or bugs, or billing, or angry customers, or urgent issues; otherwise route to sales.

Split into separate conditions, one per decision

Asking it to take action

If match, assign to Tier 2; if no match, send a CSAT; if maybe, add label "Review".

Each AI condition makes one match/no-match decision. Use workflow actions to carry out an action after the prompt step.

Details that are not in the thread context

Match if the customer's company in our CRM is in the manufacturing sector.

AI can only use the thread context Plain provides. External data isn't available.

Contradictory or impossible to follow

Match only if the customer never mentioned pricing, but also asked for a quote.

Use consistent rules

Purely standard rules

Match if the thread has label "Billing"

Use standard conditions, like Contains label in this example

Over-reliance on negation

Don't match if it's not a duplicate of something that isn't a duplicate unless it's not spam.

Use positive statements

Unbounded "use your judgment" asks

Use your best judgment to decide if this thread is important.

Give specific criteria. AI can't guess what "important" means for your workflow.