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

# Database trigger

> Kick off a workflow when a row is added or updated in a database table.

The **Database Trigger** step is your workflow's starting point. Use this step to define which changes in
your database (or external events) will automatically kick off your workflow.

<Tip>
  To add this trigger, ask the **AI Agent** for the workflow you want. It will automatically create the trigger for you based on your database schema and your workflow goals. For any changes you'd like to make, you can either ask the AI or adjust the schedule details manually in the editor.
</Tip>

<Frame caption="Example: A new row added in the 'users' table triggers the workflow.">
  <img src="https://mintcdn.com/notikaai/k35ntJQ2S6c87rnB/images/trigger.png?fit=max&auto=format&n=k35ntJQ2S6c87rnB&q=85&s=646c760107dd6ff950ac5e611739bcd6" alt="Database Trigger Example" width="3456" height="1986" data-path="images/trigger.png" />
</Frame>

## Breakdown

<Steps>
  <Step title="Pick a schema & table" icon="table">
    Choose the schema and table to watch. Dreamlit automatically infers the output
    shape of the data from the table structure.
  </Step>

  <Step title="Select trigger type" icon="bell">
    Decide whether the trigger should fire on new rows (insertions), updates, or
    both. For updates, you can optionally specify the columns to watch.
  </Step>
</Steps>

<Note>
  Note: the trigger only becomes active and applied to your table when you
  **publish** your workflow. Until then, no events will be logged.
</Note>

## Explore further

<CardGroup cols={2}>
  <Card title="How it works" icon="gears" href="/docs/getting-started/how-it-works">
    Get an overview of how Dreamlit's architecture works.
  </Card>

  <Card title="Configuring your database" icon="database" href="/docs/configuration/data-sources/supabase">
    Learn how to configure your database, and how Dreamlit interacts with it.
  </Card>
</CardGroup>
