> For the complete documentation index, see [llms.txt](https://v4.elsaworkflows.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v4.elsaworkflows.io/essentials/first-workflow.md). Agents can also search and read this documentation through its [MCP server](https://v4.elsaworkflows.io/~gitbook/mcp).

# Your first workflow

Start the [local Workbench and Studio demo](https://v4.elsaworkflows.io/essentials/quickstart.md) and sign in to Studio.

You will publish a workflow containing one Write Line activity, run that published artifact, and inspect its result:

![Create a definition, publish an artifact, run it, then inspect its execution](https://3970985350-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgq3cpwGkKOuvVeJzeNZN%2Fuploads%2Fgit-blob-3c7209d36ad05467b37935f08dbaeb38257f62b4%2Ffirst-workflow.svg?alt=media)

> **Tested with** Studio revision `7cb2f2c2`, Write Line `4.0.5-preview` and Flowchart `4.0.3-preview`. The screenshots show definition `14J7GEWeguo` and run `14J7GJS3fOg`. This walkthrough follows the published-image pair's recorded UI journey; later preview versions can change labels or behaviour.

## Create and publish

1. Open **Workflow Definitions** and create a workflow using the default Flowchart.
2. Choose **Add activity**, search for `WriteLine`, and select **Write Line** (singular).
3. Set **Text** to a recognizable message, such as `Hello from my first Elsa workflow`.
4. Choose **Review & publish**. In the **Review and publish** dialog, choose **Publish**. Note the published artifact identifier.

<img src="https://3970985350-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgq3cpwGkKOuvVeJzeNZN%2Fuploads%2Fgit-blob-2c51b18021f72e3552077b939d7c43ff79401c46%2Felsa4-03-workflow-definitions_studio-7cb2f2c2_act-4.0.5-preview.png?alt=media" alt="Studio Workflow Definitions list showing one draft workflow named Hello first workflow" width="800">

*The Workflow Definitions list with the new draft.*

<img src="https://3970985350-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgq3cpwGkKOuvVeJzeNZN%2Fuploads%2Fgit-blob-4d924c4335f174174c8674f0c64fbe4e1d1fc031%2Felsa4-04-designer_studio-7cb2f2c2_act-4.0.5-preview.png?alt=media" alt="Studio designer with a Flowchart containing a single Write Line activity marked as the start" width="800">

*The designer with one Write Line activity.*

<img src="https://3970985350-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgq3cpwGkKOuvVeJzeNZN%2Fuploads%2Fgit-blob-98387d40164befe727340a30ce51782b2ed4c7b2%2Felsa4-05-review-and-publish_studio-7cb2f2c2_act-4.0.5-preview.png?alt=media" alt="Review and publish dialog showing the default publication channel, version and captured changes" width="800">

*The Review and publish dialog. The proposed version depends on what is already published.*

## Run the published workflow

Open **Workflows → Executables** and run the artifact you just published. The editor's Run action starts a draft test run; use Executables to follow this published-workflow journey.

<img src="https://3970985350-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgq3cpwGkKOuvVeJzeNZN%2Fuploads%2Fgit-blob-76bdc8c31500cb908cb856b95fb097c4b4809703%2Felsa4-06-executables_studio-7cb2f2c2_act-4.0.5-preview.png?alt=media" alt="Studio Executables list showing the published artifact with Inspect, Run and Export actions" width="800">

*The published artifact in Executables.*

After it starts, choose **Open Run** in the status line, or open **Workflows → Runs**. Check that it belongs to the published artifact and has status **Completed**. Its timeline should contain exactly one completed Write Line activity. Open the run-details **Activity** and **Issues** tabs (they appear as ACTIVITY / ISSUES). At 1024 px on this pinned Studio the labels can clip; hover a tab or widen the window. The run should have zero incidents and an empty Issues view.

<img src="https://3970985350-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgq3cpwGkKOuvVeJzeNZN%2Fuploads%2Fgit-blob-c8116edee36417bcc43851421d9091fea3ebdd71%2Felsa4-07-run-timeline_studio-7cb2f2c2_act-4.0.5-preview.png?alt=media" alt="Completed run with the Write Line activity marked Completed and a timeline listing Flowchart and Write Line as OK" width="800">

*The completed run and its timeline.*

In your demo terminal, inspect the Workbench output:

```bash
docker compose -p elsa-first-workflow -f docker-compose.images.yml logs --no-color elsa-workbench
```

Use the `-p` project name you chose in the quickstart (that flag overrides the compose file's `name: elsa-stack`). Your unique message should appear once for this run. If you ran the workflow again, account for those additional runs when reading the log.

## Understand the result

You created a definition, published an artifact, and executed that artifact. The [How a workflow executes](https://github.com/elsa-workflows/elsa-foundation/blob/main/docs/how-a-workflow-executes.md) guide explains the runtime path in more detail. Use the [local demo cleanup steps](https://v4.elsaworkflows.io/essentials/quickstart.md#stop-the-demo) when you finish.

> *Good to know:* the [recorded browser verification](https://github.com/elsa-workflows/elsa-foundation/blob/69f067104c1a977d897911db7ecf16037cfbe542/docs/contributing/published-image-pair.md#recorded-image-provenance-and-hosted-result) covers a specific image pair and Linux/amd64 environment. It is automated technical evidence, rather than a human newcomer trial or proof for every later preview.

> **Limitation:** Native publish (including Studio's **Review & publish**) and direct BPMN publish save the compiled material before the publication that retains it is committed. Until that publication exists, the saved material is not guaranteed to be kept. After the artifact-creation grace period (5 minutes by default), garbage collection may remove it. An interrupted publish can be retried. The default Workbench does not run the garbage-collection pump, so the local demo does not exercise this path.

***

[Edit this page on GitHub](https://github.com/elsa-workflows/elsa-foundation/edit/main/website/docs/essentials/first-workflow.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://v4.elsaworkflows.io/essentials/first-workflow.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
