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

# Build your first workflow

> Create an Asteroid integration, run it against a real portal, and read the result.

Read [What Asteroid is](/start/what-asteroid-is) first.

This page helps you create your first healthcare system integration. It takes a few minutes. Open the [Asteroid platform](https://platform.asteroid.ai) and follow along.

An Asteroid integration is built using a workflow, split into steps. Each step can be either fully written in code or it can use AI, or a mixture of both. Code is cheaper to run but less flexible.

Most customers start with a fully AI-powered integration that is flexible but slow and expensive. Then, they use Astro to convert the workflow into code where possible so that it runs quickly and cheaply.

Our assistant Astro is the best way to build and optimize your Asteroid workflows.

<Steps>
  <Step title="Create the integration">
    Sign in, click Create, and describe to Astro the task you want your integration to do

    Start with the goal in one line. Then list the steps in order. For example:

    ```
    Fill in the doctor note information in my EHR portal.

    1. Go to https://mediflowhealth.life/login
    2. Log in with the email and password available to you
    3. Click the "Patients" button
    4. Select {{.NAME}}
    5. Click "New Consultation"
    6. Fill out the consultation form using the following doctor note: {{.DOCTOR_NOTE}}
    7. Click "Create" to finish
    ```

    Note:

    * The integration signs in with credentials in an [Agent profile](/concepts/profiles).
    * `{{.NAME}}` and `{{.DOCTOR_NOTE}}` are inputs. You supply their values at execution time. See [Inputs and outputs](/concepts/inputs-and-outputs).
  </Step>

  <Step title="Work together with Astro">
    Astro will start building your integration. You can interact with Astro via the chat.

    Astro might open up a web browser in order to sign in to the portal and gain a better understanding of how to construct the integration.

    Astro might also ask you questions to clarify anything that requires your input.
  </Step>

  <Step title="Look at the graph">
    Astro, our builder, turns your description into a graph. Open it and read what it made.

    The graph holds two things:

    * **Nodes** — one narrow subtask each. See [Nodes](/concepts/nodes).
    * **Transitions** — the rules that pick the next node. See [Transitions](/concepts/transitions).

    A new workflow usually starts as three nodes: a start node, one that does the work, and one that returns the outcome. That is enough for a first execution. Split it up later, as the task grows. Read [Workflows are graphs](/concepts/graphs).

    Rename the workflow while you are here with a clear name.
  </Step>

  <Step title="run it">
    Pick a profile, fill in the inputs, and start the execution.

    Click **Run** in the builder. The execution configuration opens. Set two things:

    1. **Agent profile** — the credentials and settings the execution uses. Select one, or create one now. See [Agent profiles](/concepts/profiles).
    2. **Inputs** — a value for every variable your instructions reference, such as `NAME` and `DOCTOR_NOTE`.

    You can also attach files for the workflow to read during the execution. See [Workflow filesystem](/concepts/filesystem).

    Start the execution.
  </Step>

  <Step title="Watch it work">
    <Card title="Execution page" img="https://mintcdn.com/entropylabs/3oe4MLArATqq2JLD/images/quickstart-run2.png?fit=max&auto=format&n=3oe4MLArATqq2JLD&q=85&s=b58ab7eb6f9c939fc38bcbd792785076" icon="eye" horizontal width="1606" height="965" data-path="images/quickstart-run2.png">The execution opens live. Watch the workflow drive the browser, step by step.</Card>

    From this page you can:

    * Send the workflow a message while it works
    * Pause or cancel the execution
    * Take the browser and click in it yourself

    An execution moves through a fixed set of statuses, and ends in one of `completed`, `failed`, or `cancelled`. See [Executions and statuses](/concepts/executions).
  </Step>

  <Step title="Read what happened">
    Open the execution on the **Executions** page. Read the timeline first. It shows each node the workflow entered and each action it took.

    Then read the result. The output node returns an outcome label and structured data. The label tells you which ending the workflow reached. See [Inputs and outputs](/concepts/inputs-and-outputs).

    Your first execution may not pass. That is normal, and the timeline shows you where it stopped. See [Debug your workflows](/operate/debug).
  </Step>

  <Step title="Iterate">
    You're unlikely to make the perfect integration first time; you might have forgotten about an edge case or not accurately specified your task in some way.

    You can go back to Astro and explain any issues, and it will help you to fix them.

    See [Improve your workflows](/operate/improve) for best practices on iterating on your workflows.

    Part of this will very likely involve [scripting your workflow](/operate/scripts) to make it cheaper, faster and more reliable.
  </Step>

  <Step title="Deploy">
    Once you have a workflow that you're happy with, it's time to deploy it. See [Integrate](/integrate/production-checklist) for more information on how to go live.
  </Step>
</Steps>

## Next

<CardGroup cols={2}>
  <Card title="Write good instructions" icon="pen-line" href="/build/instructions" horizontal>Make the workflow do the same thing every time.</Card>
  <Card title="Test, iterate, publish" icon="rocket" href="/build/test-and-publish" horizontal>Ship a version your systems can call.</Card>
  <Card title="Call a workflow from your code" icon="code" href="/integrate/call-an-agent" horizontal>Start executions by API and read the results.</Card>
  <Card title="Workflows are graphs" icon="workflow" href="/concepts/graphs" horizontal>Understand nodes, transitions, and why small steps win.</Card>
</CardGroup>
