# Triggers & Execution

Workflows can be started in four ways.

## Manual (from the Editor)

1. Open a deployed workflow.
2. Click the ***green play button*** on the bottom left of the canvas.

   <figure><img src="/files/gNDJHrXkehF6zMbJQSix" alt=""><figcaption></figcaption></figure>
3. Enter a JSON, XML, or file input payload.
4. Click ***Execute***.

   <figure><img src="/files/w7DA4KLF8ip4Z8md9kBP" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Your input is saved automatically for repeat testing.
{% endhint %}

## Webhook / REST API

Any system can trigger a workflow via HTTP POST:

```
POST {tillitURL}/wire-flow/api/invoke/{workflowId}
```

Requires a valid Bearer token (the same session token used by the Wire Flow app):

```bash
curl -X POST https://bottling.tillit-sandbox.cloud/wire-flow/api/invoke/wf-abc123 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"orderNumber": "ORD-001"}'
```

The request body becomes the workflow input (max 256 KB). The invoke URL is shown in the editor toolbar and in the Start Trigger properties panel.

## MQTT Trigger

Publish a message to an IoT Core topic to trigger a workflow automatically:

```
{env}_wire_flow/{tenant}/{workflowId}
```

Example: `stage_wire_flow/bottling/order-processor`

The full topic for your workflow is shown in the **Start Trigger** properties panel.

To publish a message, use an MQTT client (e.g., MQTT Explorer) with the certificates downloaded from TilliT. Connect to the TilliT IoT endpoint and publish to the topic shown in the Start Trigger properties panel.

{% hint style="info" %}
Failed MQTT triggers are queued for review. Common reasons: workflow not deployed, invalid workflow ID.
{% endhint %}

## File Upload Trigger

For workflows that process files (CSV, Excel, XML):

1. Drag a ***File Trigger*** node onto the canvas (blue upload icon).
2. Click the upload arrow on the node, or click ***Upload & Execute*** in the Properties Panel.
3. Select a file (`.csv`, `.xlsx`, `.xls`, `.xml`, `.json`).
4. The workflow auto-deploys, the file is uploaded, and execution starts.

The workflow receives a file reference object as its input:

```json
{
  "s3Bucket": "sandbox-step-functions",
  "s3Key": "bottling/uploads/wf-abc123/orders.csv",
  "fileName": "orders.csv",
  "contentType": "text/csv"
}
```

This is the expected input format for the CSV Parser, Excel Parser, and XML Parser tasks.

{% hint style="warning" %}
File size limit: **50 MB**.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.tillit.cloud/tillit/knowledge-base/setting-up-tillit/integrations/wire-flow/triggers-and-execution.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
