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

# How to Build and Run Your First Workflow in Chevre

> Learn how to create and run your first Chevre workflow — configure a trigger, add a Slack notification action, and go live in minutes.

Workflows in Chevre are sequences of steps that execute automatically when a triggering event occurs. Each workflow starts with a single trigger — something that happens in your workspace, like a project being created — and then carries out one or more actions in response. In this guide, you'll build a workflow that fires whenever a new project is created and immediately sends a Slack notification to your team channel.

<Note>
  Before you start, make sure you have the following in place:

  * An active Chevre account
  * At least one workspace already created
  * The Slack integration connected to your workspace (see [Connecting Integrations](/guides/integrations) if you haven't done this yet)
</Note>

## Create your workflow

<Steps>
  <Step title="Open your project">
    In the left sidebar, click the project you want to add the workflow to. Once inside the project, navigate to the **Workflows** tab and click **+ New Workflow** in the top-right corner.
  </Step>

  <Step title="Name your workflow">
    In the dialog that appears, type `New Project Alert` as the workflow name. A clear, descriptive name makes it easier to identify this workflow later in your run history and automation logs. Click **Continue** to proceed.
  </Step>

  <Step title="Configure the trigger">
    On the workflow canvas, click the **Trigger** block to open the trigger configuration panel. From the trigger list, select **Project Created**. This tells Chevre to start this workflow every time a new project is created in your workspace. No additional trigger settings are required for this event type.
  </Step>

  <Step title="Add an action">
    Below the trigger block, click **+ Add Step**. From the action library, select **Send Slack Message**. Configure the action with the following settings:

    * **Channel** — choose the Slack channel where notifications should be posted (for example, `#general` or `#projects`)
    * **Message** — enter the message text you want to send. Use template variables to make it dynamic:

    ```text theme={null}
    📁 New project created: {{project.name}}
    Created by {{actor.name}} in {{workspace.name}}.
    ```

    Chevre replaces each `{{variable}}` with real data at the time the workflow runs.
  </Step>

  <Step title="Save and enable">
    Click **Save** in the top-right corner to save your workflow. By default, new workflows are created in a disabled state. Toggle the **Enabled** switch at the top of the canvas to activate it. The toggle turns green when the workflow is live.
  </Step>

  <Step title="Test it">
    Trigger the workflow by creating a new project in your workspace — go to the **Projects** page and click **+ New Project**, fill in the details, and save. Within a few seconds, you should see the Slack notification appear in your chosen channel.

    To confirm the run succeeded, return to your workflow and click the **Run History** tab. You'll see a timestamped log entry for the run, along with its status, inputs, and outputs for each step.
  </Step>
</Steps>

## Workflow variable reference

Template variables let you inject live data into your workflow actions. Wrap any variable name in double curly braces to use it in a message, subject line, or any text field.

| Variable             | Description                                       | Example value           |
| -------------------- | ------------------------------------------------- | ----------------------- |
| `{{project.name}}`   | The display name of the project                   | `Q3 Marketing Campaign` |
| `{{project.id}}`     | The unique identifier of the project              | `proj_01hx3k9z`         |
| `{{actor.name}}`     | The full name of the user who triggered the event | `Jordan Lee`            |
| `{{workspace.name}}` | The name of your Chevre workspace                 | `Acme Corp`             |

<Tip>
  To create a similar workflow without starting from scratch, right-click any workflow in the **Workflows** tab and select **Clone Workflow** from the context menu. The clone opens as a new draft that you can rename and modify independently.
</Tip>

## Creating projects via the API

If you prefer to work programmatically, you can create a project — and trigger the same **Project Created** workflow — using the Chevre REST API. First retrieve the workspace ID you want the project to live in, then post the new project.

**List your workspaces**

```bash theme={null}
curl https://api.chevre.io/v1/workspaces \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

**Create a project in a workspace**

```bash theme={null}
curl -X POST https://api.chevre.io/v1/projects \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": "ws_01hx3k9z",
    "name": "Q3 Marketing Campaign"
  }'
```

A successful request returns a `201 Created` response with the new project object. Any workflow with a **Project Created** trigger in that workspace fires automatically — exactly as it would when a project is created through the UI.

<Note>
  Replace `YOUR_API_TOKEN` with a token generated in **Settings → API Tokens**. Keep tokens secure and rotate them regularly.
</Note>

## Next steps

Now that your first workflow is running, explore what else Chevre can automate for you.

<CardGroup cols={2}>
  <Card title="Creating Automations" icon="bolt" href="/guides/automations">
    Build event-based rules and scheduled tasks to automate repetitive work across your workspace.
  </Card>

  <Card title="Connecting Integrations" icon="plug" href="/guides/integrations">
    Connect Slack, GitHub, Google Workspace, and more to extend what your workflows can do.
  </Card>
</CardGroup>
