Running a Triggered Task

Invoking a Pipeline through a Triggered Task

The SnapLogic Platform offers various ways to run Tasks. Because Triggered Tasks are a convenient way to give API consumers a URL to invoke a Pipeline without actually granting them access to the SnapLogic Platform, you should consider how and where the Task is executed.

The cloud URL for a Triggered Task running on a Groundplex does not support asynchronous Pipeline execution.


You can invoke a Triggered Task using one of the following methods.

From SnapLogic Manager:

  1. In Manager, navigate to the target Task, and click  to open the context menu:  

  2. Click Details.
  3. Click Execute for the URL to run the Pipeline (you may be prompted to log in).

    Alternatively, you can click  to copy the URL, and then paste it into a browser.

    Executing the Task by clicking Execute in Manager automatically picks up the authentication credentials.

    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.

    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. 


For information on API Management aspect of Triggered Tasks, see API Management.

If your account is locked or your password expired, you can still execute Triggered Tasks; however, you cannot invoke SnapLogic Public APIs, and your Scheduled Tasks will fail to execute.

CURL Command Examples of Triggered Tasks

This section covers some examples of using the CURL command-line tool to access Task URLs.  The following are only examples of the syntax and are not functioning URLs.

Run a Pipeline that takes no input and has an unlinked output view that writes documents:

$ curl -u 'user@example.com: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 'user@example.com: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 '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 'user@example.com: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!" }