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

# Write a goal the agent can follow

> The goal is your instructions to the Work agent. Learn what to put in it, see a complete example, and avoid the common mistakes.

The **goal** is the most important thing you write in Work. It is the only instruction the Work agent has for a job. A clear goal gives you an agent that behaves like your best coordinator. A vague goal gives you an agent that guesses.

The good news: you write it in plain language, the way you would brief a new colleague.

## What a goal is

A goal describes the **result you want** and the **rules for getting there**. It is not a script of exact messages. The agent works out the wording and the next step from what actually happens.

The agent reads the goal every time it picks a Work Item back up: when the request arrives, when someone replies, and when a wake-up fires.

## Where to write it

1. Go to **Settings → Pipelines** and open your pipeline.
2. Open the **Agent** step.
3. Write in the **Goal** box, or click the pencil icon beside **Goal** to write it with Ask Z.

![The Agent step of a pipeline. Approval policy and Reasoning mode selectors are at the top. Below them, the Mass outreach switch is on and two buckets are listed, each with a bucket name, a channels selector, and a description. The Goal box is at the bottom with a pencil icon on its right.](https://mintcdn.com/z360-fe526747/sOi4qySNiv1nnWzq/images/work/pipeline-agent-step.png?fit=max\&auto=format\&n=sOi4qySNiv1nnWzq\&q=85\&s=c8010be8a65a252cfcc3d5a459a28fcd)

The Goal box is at the bottom of the Agent step, with the pencil icon on its right.

## The fastest way: ask Ask Z

Ask Z knows what a Work goal needs and will ask you about anything missing.

Click the pencil icon beside **Goal**, then describe the job. For example:

```text theme={null}
This pipeline handles maintenance requests from tenants.
Text the tenant from our office number to confirm and ask for visit times.
Email the right vendor for two visit times.
Remind the vendor once after one working day.
Ask me before agreeing to any cost above $300.
The job is done when the tenant confirms the problem is fixed.
```

Ask Z shows you the full goal and a short example of how a job would run. Read both, correct anything that is wrong, then confirm.

## The six questions every goal should answer

Whether you write the goal yourself or with Ask Z, check it against these.

**1. What happens first?**

When a new Work Item arrives, what is the very first action? Usually: find or create the contact, then send the first message.

**2. Who is contacted, and how?**

Name each person or business involved, the channel to use (email, text, or call), which of your addresses or numbers to send from, and what to ask or tell them.

**3. When does the agent follow up?**

Say how long to wait, how many reminders to send, and what to do after the last one. "Follow up" on its own is not enough.

**4. What moves the job to each stage?**

Tie every stage to something that can be checked. "Move to **Visit scheduled** when both sides confirmed the same time."

**5. What counts as finished?**

Describe **Completed** (the goal was met) and **Failed** (it could not be met, and why). Without this, jobs stay **In progress** forever.

**6. When should it stop and ask a person?**

List the decisions that belong to your team: costs above a limit, complaints, anything unusual.

## Say which address or number to send from

A goal is plain text. There is no special block or code to add for senders. Tell the agent which of your connected email addresses or phone numbers to use, the same way you would tell a colleague:

```text theme={null}
Text tenants from our office number, (555) 010-0142.
Email vendors from service@oakstreet.example.
```

What the agent does with this:

* **You named a sender.** The agent uses it.
* **You did not name one.** The agent picks a suitable connected address or number, based on who it is contacting and the conversation so far. If the choice is not clear, it asks your team.
* **Mass outreach is on.** The pipeline hands each Work Item a sender from a bucket, so you do not name one in the goal. To set up buckets, see [Turn on mass outreach](https://docs.z360.biz/guides/work/mass-outreach.md#turn-on-mass-outreach).

> [!TIP]
>
> If you have more than one address or number, always name the one to use. Then the agent never has to guess.

## A complete example

This is a full goal for the maintenance pipeline used across this section. Copy the shape, then replace the details with your own. This pipeline does not use mass outreach, so the goal names its senders. With mass outreach on, leave out the "Send from" section.

```markdown theme={null}
# Maintenance requests

## Purpose
Get every maintenance request fixed. A vendor visit is booked at a time
the tenant accepts, and the tenant confirms the problem is solved.

## Send from
- Text tenants from our office number, (555) 010-0142.
- Email vendors from service@oakstreet.example.

## When a new request arrives
1. Find the tenant in Contacts by phone or email. Create the contact if
   it does not exist.
2. Text the tenant from our office number. Confirm we received the
   request and ask which days and times work for a visit.
3. Email the vendor for this type of problem (see Vendors). Describe the
   problem, give the address, and ask for their two earliest visit times.
4. Move the Work Item to "Vendor contacted".

## Vendors
- Plumbing: Ace Plumbing, service@aceplumbing.example
- Electrical: Bright Electric, jobs@brightelectric.example
- Anything else: ask the assigned teammate which vendor to use.

## Follow-ups
- Vendor: if there is no reply by 9 AM the next working day, send one
  reminder. If there is still no reply a day later, ask the assigned
  teammate.
- Tenant: if there is no reply after 24 hours, send one reminder by
  text. After two reminders with no reply, mark the Work Item Failed
  and say why.

## Scheduling
- Offer the tenant only the times the vendor gave.
- When both agree on a time, confirm it with both of them, then move
  the Work Item to "Visit scheduled".

## After the visit
The morning after the visit, text the tenant to ask if the problem is
fixed.
- Fixed: thank them, move to "Done", and mark the Work Item Completed.
- Not fixed: tell the vendor and go back to Scheduling.

## Ask a teammate before
- Agreeing to any cost above $300.
- Booking an urgent request that the vendor cannot visit within 24 hours.

## Never
- Share one tenant's details with another tenant.
- Promise a date the vendor has not confirmed.
```

Notice what makes it work:

* **The senders are named.** The agent does not have to guess which address or number to use.
* **Stage names match the pipeline exactly.** The agent can only move a Work Item to a stage that exists.
* **Every wait has a number.** "24 hours", "the next working day", "two reminders".
* **Both endings are defined.** The agent knows when to mark **Completed** and when to mark **Failed**.
* **The human decisions are listed.** The agent will not agree to a \$900 repair on its own.

## Vague versus clear

| Instead of this | Write this |
| - | - |
| Follow up with the customer. | If there is no reply after 2 working days, send one reminder on the same channel. After two reminders, mark the Work Item Failed. |
| Contact the vendor. | Email the vendor from our service address. Ask for their two earliest visit times. |
| Move the stage when ready. | Move to "Visit scheduled" when the tenant and the vendor have both confirmed the same time. |
| Close the job when done. | When the tenant confirms the fix, move to "Done" and mark the Work Item Completed. |
| Escalate problems. | Ask the assigned teammate before agreeing to any cost above \$300. |

## Change a goal safely

The agent rereads the goal each time it picks a Work Item back up. That means a change also affects Work Items that are **already in progress**, not only new ones.

Before you change a live goal:

1. Check what is in progress. In **Work**, filter by the pipeline and the agent status **In progress**.
2. Make one change at a time.
3. Run a test request, as described in [Set up your first Work pipeline](https://docs.z360.biz/guides/work/set-up-your-first-work-pipeline.md#test-it-before-you-share-it).

## Tips

* **Write for a new colleague.** If a new hire could not follow the goal without asking you questions, the agent cannot either.
* **Put facts in the goal.** Vendor names, price limits, office hours. The agent only knows what you tell it, plus what it can look up in your Z360 records.
* **Use headings.** Short sections such as "Follow-ups" and "Ask a teammate before" are easier for you to maintain and easier for the agent to follow.
* **Keep one pipeline to one job.** If the goal needs "if this is a sales request… but if it is a repair…", you need two pipelines.
* **Say what never to do.** A short "Never" list prevents the mistakes you worry about most.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.