# Creating a Workflow

## Creating a Workflow

Let’s build a Workflow that enrolls patients.

## Creating a Workflow

Start with a prompt.

## Creating a Workflow

Add your business facts.

## Creating a Workflow

Test it, then publish.

## Creating a Workflow

Next, collect the patient’s details.

## Creating a Workflow

Check their consent.

## Creating a Workflow

Book a visit.

## Creating a Workflow

Test both paths.

## Creating a Workflow

And connect your phone.

## Creating a Workflow

Let’s build it.

## Write a prompt

First, a prompt.

## Open Workflows

Open Workflows. A Workflow holds the instructions an Agent follows.

## Create a Workflow

Click Create Workflow. Name it, and write a prompt. Multi-step is on by default. Create it, then open Settings to see the prompt.

## Add facts

Now the facts.

## Add business facts

In Settings, open Abilities and add an ability. Choose File Access, then Add Files and Folders. Pick your facts file and confirm. Save.

## Test and publish

Then test and publish.

## Test a question

In Evaluate, pick a test persona. Choose Manual and start. Ask when you close on Friday, then check the answer against your facts.

## Publish

Publish this version once it answers correctly. The editor keeps a draft for your next changes.

## Collect details

Next, patient details.

## Patient enrollment

Create a second Workflow, called Patient Enrollment, with a short prompt. Then open its Start Task. Rename it Enrollment, and tell the Agent what to collect. Save.

## Collect enrollment details

On the Enrollment Task, open Abilities and add an ability. Choose Form Access, then the Enrollment Form. Let the Agent read, create and edit its records. Save.

## Check consent

Then consent.

## Check consent first

Add an Insurance Task after Enrollment. It collects the provider and member ID. Create it. Connect them, and advance automatically when contact consent is true. Save the connection. Then give Insurance Form Access to Insurance Information. Save.

## Book a visit

Now booking.

## Add consultation booking

Add one last Task, to book the consultation. Tell the Agent to offer an available chiropractor. Create it. Open Abilities, choose Calendar Booking, and pick a calendar and the Initial Consultation type. Do the same for the second calendar. Save.

## Test both paths

Then the tests.

## Test both paths

Now test both paths. Without consent, the Chat stays on Enrollment. With consent, it moves on to Insurance.

## Answer calls

Last, the phone.

## Answer calls

For Member calls, open Connections, then Phone, and choose your line. Edit the Members rule, and choose Patient Enrollment. Then open the Workflow’s Comms settings and pick the line it calls from.

## Creating a Workflow

That’s a Workflow that enrolls patients and checks consent. More at docs.gravityrail.com.
