# External trigger

The task "**External trigger**" needs to be placed at the very beginning of the pipeline if you want to execute it by calling [Ylem's API](https://docs.ylem.co/api/api-endpoints#run-pipeline) from the outside.

The following cases are the most common for such a situation:

* Trigger pipeline from [Apache Kafka](https://docs.ylem.co/integrations/library-of-integrations/apache-kafka), [AWS Lambda](https://docs.ylem.co/integrations/library-of-integrations/aws-lambda), [AWS S3](https://docs.ylem.co/integrations/library-of-integrations/aws-s3), [Google Pub/Sub](https://docs.ylem.co/integrations/library-of-integrations/google-pub-sub), [RabbitMQ](https://docs.ylem.co/integrations/library-of-integrations/rabbitmq)
* Trigger pipeline by [calling an API](https://docs.ylem.co/api/api-endpoints#run-pipeline) directly or calling it from your custom script

The input dataset that you transfer to the API endpoint will also be available in the task that follows "**External trigger**":

The following simple pipeline example accepts data from outside and forwards it further as a notification.

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2F8ebxZAdQD7GqYgQT0Gbn%2FScreenshot%202024-04-29%20at%2015.00.46.png?alt=media&#x26;token=ebed9126-0669-45cb-a2d4-59e5954c7c40" alt=""><figcaption></figcaption></figure>

Let's send the following JSON as input to the [API endpoint](https://docs.ylem.co/api/api-endpoints#run-pipeline) that triggers this pipeline:

```json
{
    "info": "some information",
    "customer_id": 1
}
```

As you can see the input dataset is available in the "Notification task" as a whole under the `{{ INPUT() }}` function and also every input key-value pair is available separately by its key name.

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FINLgwAu69ZRf93DywFZI%2FScreenshot%202024-04-29%20at%2015.01.03.png?alt=media&#x26;token=bde5e2f6-37b2-45ab-a7c0-acb18337a5c8" alt=""><figcaption></figcaption></figure>
