Run Triggered Task
The SnapLogic Platform offers various ways to run Tasks. Because Triggered Tasks allow API consumers to invoke a pipeline through a URL, it's essential to consider how and where the task is executed.
You can invoke a Triggered Task using one of the following methods.
- In Classic Manager, navigate to the target task, and click
to open the context menu:
- Click Details.
- Click Execute for the URL to run the pipeline.Alternatively, you can click
to copy the URL, and then paste it into a browser.
Note: Executing the Task by clicking Execute in Manager automatically picks up the authentication credentials.Note: Duplicate Task Executions: If a Task fails to start with the same reason for multiple times in a row, then subsequent skips are not displayed on the Task details page.
From a Client Machine:
- In your browser window, copy and paste the URL generated for the target task.Note: Authentication: The external URL created for a task requires you to be authenticated with the SnapLogic servers. When using a web browser to access the URL, you might not have to provide credentials since you might already be logged into the Designer. Using other methods to request the Task URL requires you to provide credentials using HTTP Basic Authentication. Alternatively, you can run tasks from a CLI using Curl commands.
CURL Command Examples of Triggered Tasks
$ curl -u '[email protected]:mypassword' 'https://elastic.snaplogic.com/api/1/rest/slsched/feed/example/jobs/test-reader'
{ "msg" : "Hello, World!" }
Run a pipeline that takes a parameter and has an unlinked output view that writes a document:
$ curl -u '[email protected]:mypassword' 'https://elastic.snaplogic.com/api/1/rest/slsched/feed/example/jobs/test-hello?Name=John'
{ "msg" : "Hello, John!" }
Run a pipeline using a Bearer token for authentication through a header:
$ curl -H 'Authorization: Bearer Xrcuwn2zVLqR7KXXXXXXXXX' 'https://elastic.snaplogic.com/api/1/rest/slsched/feed/example/jobs/test-hello?Name=John'
{ "msg" : "Hello, John!" }
Run a pipeline using a Bearer token for authentication through the bearer_token query parameter:
$ curl -H 'Authorization: Bearer Xrcuwn2zVLqR7KXXXXXXXXX' 'https://elastic.snaplogic.com/api/1/rest/slsched/feed/example/jobs/test-hello?Name=John'
{ "msg" : "Hello, John!" }
Run a pipeline using a Bearer token for authentication through the bearer_token query parameter:
$ curl 'https://elastic.snaplogic.com/api/1/rest/slsched/feed/example/jobs/test-hello?Name=John&bearer_token=Xrcuwn2zVLqR7KXXXXXXXXX'
{ "msg" : "Hello, John!" }
Run a pipeline that accepts a JSON document and transforms it:
$ curl -u '[email protected]:mypassword' --data-binary '{ "name" : "Bob" }' --header "Content-Type:application/json" https://elastic.snaplogic.com/api/1/rest/slsched/feed/example/jobs/test-transformer
{ "msg" : "Hello, Bob!" }