# Public API Trigger

Imagine being able to kick off your workflows automatically from any system or application. That's exactly what the Public API trigger enables - it lets you programmatically start workflows through simple HTTP requests.

## What is it?

The Public API trigger is a powerful way to integrate MindPal workflows into your existing systems and applications. It provides a REST API endpoint that you can call to start a workflow execution with custom data.

## When to use it?

Use the Public API trigger when you want to trigger a workflow on MindPal to run programmatically from an external system or application, such as:

- A custom application you're building
- A cross-app integration platform like Zapier or Make

## How it works?

1. Send a POST request to the Public API endpoint with the workflow input data
2. The workflow starts executing with the provided data
3. You receive a response with the execution details

## Configuring the API request

The complete API documentation is available [here](https://api-v3.mindpal.io/docs).

For workflow-specific API details:

1. Open your workflow
2. Go to the "API Reference" tab
3. Find detailed documentation customized for your workflow's specific input schema

## Frequently Asked Questions

### How do I get the workflow run results?

Since workflows run asynchronously, when you trigger a workflow via the Public API, you'll immediately receive a workflow run ID rather than the final results. This is because workflows can take time to complete. There are two ways to get the workflow run results:

1. **Using Webhook Node (Recommended)**: Add a [Webhook Node](/workflow/build/webhook-node) at the end of your workflow. Once the workflow completes, it will automatically send all results to your specified webhook URL.

2. **Polling the Results API**: Use the workflow run result endpoint to retrieve results using the workflow run ID:

   ```
   GET /api/workflow-run-result/retrieve-by-id
   ```

   See the complete [API documentation](https://api-v3.mindpal.io/docs#/Results/get_workflow_run_by_id_api_workflow_run_result_retrieve_by_id_get) for details.
