> ## 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.

# Start a Workflow When a Deal Is Won

> Have a workflow run every time a deal is marked won, such as making a task to send a welcome pack, and test it with one of your real deals

When you win a deal there is usually a next step: a welcome pack, a kick-off call, an invoice. A workflow that starts when a deal is won does it for you, every time.

This guide makes a workflow that creates a task, "Send a welcome pack to" the deal's name, whenever Northwind wins a deal, and tests it with a real won deal.

## Start with the trigger

**1. Make a new workflow**

Click **Workflows** in the left rail, then **New Workflow**, give it a name and click **Create Blank Workflow**.

**2. Add the Deal Trigger**

Click the gear at the top right, then **Browse All Nodes**. Search for "deal" and click **Deal Trigger**.

![The step list searched for deal: Triggers, with Deal Stage Changed, Deal Trigger, outlined, and Tag Added](https://mintcdn.com/locusdigital/spQ09O8rNICFqiJR/images/how-tos/workflows/dw-01-pick-trigger-closeup.webp?fit=max\&auto=format\&n=spQ09O8rNICFqiJR\&q=85\&s=eec6e996305c01b1cb6dc5e54d77efda)

The Deal Trigger

**3. Tick Won**

In the step's settings, under **Events**, tick **Won**. The step then reads **When a deal is won**. With nothing ticked, it would start on every deal event.

![Deal Trigger, When a deal is won: Events, 1 selected, with Created, Moved to another stage, Won ticked and outlined, and Lost](https://mintcdn.com/locusdigital/spQ09O8rNICFqiJR/images/how-tos/workflows/dw-02-tick-won-closeup.webp?fit=max\&auto=format\&n=spQ09O8rNICFqiJR\&q=85\&s=607dbbe140c49268a12088600f3a0a01)

Start only when a deal is won

## Add what should happen

Add the next step the same way. Here it is **Create CRM Task**. In **Subject**, type the start of the task and add the deal's name: click the trigger, open its **Output** tab, click **deal.name** to copy it, and paste it into **Subject**.

![Create CRM Task: Subject, Send a welcome pack to, followed by the Deal Trigger deal.name value, outlined](https://mintcdn.com/locusdigital/spQ09O8rNICFqiJR/images/how-tos/workflows/dw-05-task-subject-closeup.webp?fit=max\&auto=format\&n=spQ09O8rNICFqiJR\&q=85\&s=88b33ab8c6ee3225107710e7a8e0b5be)

The task's subject, with the deal's name

Click **Save Workflow**.

## Test it with a real deal

**1. Pick a sample deal**

Click the trigger and open its **Input** tab. Under **Test sample**, click one of your won deals. The test uses it as if it had just been won; the deal itself is not changed.

![Test sample: Test run uses Larkspur Hotel in-room coffee as the deal, outlined, with Clear sample; and the deal list with Larkspur Hotel in-room coffee, Closed Won, \$12,600.00, ticked and outlined](https://mintcdn.com/locusdigital/spQ09O8rNICFqiJR/images/how-tos/workflows/dw-03-test-sample-closeup.webp?fit=max\&auto=format\&n=spQ09O8rNICFqiJR\&q=85\&s=f6b44ee94e93db719ef7d8b37da1f89c)

Larkspur Hotel's deal as the test sample

**2. Click Test Run**

Every step runs once. Steps that send or save something, like creating the task, are only simulated.

![Test completed, 2/2 steps, outlined; Deal Trigger, When a deal is won, Done; and Create CRM Task, Done, Create task Send a welcome pack..., outlined](https://mintcdn.com/locusdigital/spQ09O8rNICFqiJR/images/how-tos/workflows/dw-04-test-passed-closeup.webp?fit=max\&auto=format\&n=spQ09O8rNICFqiJR\&q=85\&s=edcc48a193585dd3cb5301c2bb4d2142)

Both steps done

Here the task step would have created "Send a welcome pack to Larkspur Hotel in-room coffee", with the name taken from the deal.

## Switch it on

When the test looks right, click the switch at the top so it reads **Enabled**. From then on, every deal marked won starts the workflow.

## Good to know

* **Lost deals too.** Tick **Lost** instead to follow up on deals you lose, or **Moved to another stage** for any stage change.
* **See each run** under **Runs**: [See What a Workflow Did](https://docs.hiveku.com/how-tos/workflows/see-what-a-workflow-did.md).
* **Building by hand:** [Build a Workflow by Hand](https://docs.hiveku.com/how-tos/workflows/build-a-workflow-by-hand.md).


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