Generate a pipeline for a Triggered or Ultra Task

Use SnapGPT to generate a pipeline you can run as a Triggered Task or an Ultra Task and call over HTTP.

You can generate a pipeline that can be run as a Triggered Task or an Ultra Task and called over HTTP.

  1. If the featured skill cards are not visible in SnapGPT, click New chat to return to the home screen.
  2. Click Generate pipeline.
  3. Modify the default prompt and ask for a pipeline for a Triggered Task or an Ultra Task.

    For example:

    • Generate a pipeline for a Triggered Task that returns the status of an order when I send the order ID in the request.
    • Generate a pipeline for an Ultra Task that validates each incoming order and returns the result with low latency.
    Tip: Describe what you need, such as the request methods, the request body, and the response codes. SnapGPT uses them to build the pipeline.
  4. Press Return or click SnapGPT Go icon.
    The SnapGPT Preview dialog opens with the generated pipeline. In the SnapGPT panel, SnapGPT describes how the pipeline responds to each request. It also explains how to create the task for the pipeline.
    SnapGPT Preview dialog showing the generated pipeline, with the task setup instructions in the SnapGPT panel

  5. In the SnapGPT Preview dialog, click Replace current pipeline or Import on new tab.
  6. Save the pipeline.
  7. In Designer or Project Manager, create a task for the pipeline. Refer to Create a Triggered Task or Create an Ultra Task.
    Create Task dialog with the Run Policy set to Triggered

  8. (Optional) In Project Manager, open your project and click the Tasks tab to confirm that the new task appears in the list.
    Tasks tab in Project Manager listing the new Triggered Task

  9. Call the task endpoint to test the pipeline.

    To get the task URL and authenticate, refer to Run Triggered Task or Invoke Ultra Tasks.

Example: price quote API

The following prompt generates a pipeline for a Triggered Task that serves a price quote API:

Create a pipeline for a Triggered Task that serves a price quote API. A GET returns a sample quote. A POST with a JSON body containing product and quantity returns HTTP 201 with the total at $10 per unit; if either field is missing, return HTTP 400 with an error message. Any other method returns HTTP 405.

After you create the Triggered Task for the generated pipeline, you can call the task with GET, POST, and PUT requests. Replace $TASK_URL, $USER, and $PASS with your task URL and credentials.

curl -i -u "$USER:$PASS" -X POST -H 'Content-Type: application/json' -d '{"product":"widget","quantity":3}' "$TASK_URL"
curl -i -u "$USER:$PASS" -X POST -H 'Content-Type: application/json' -d '{"product":"widget"}' "$TASK_URL"
curl -i -u "$USER:$PASS" -X PUT -H 'Content-Type: application/json' -d '{"product":"widget","quantity":3}' "$TASK_URL"
curl -i -u "$USER:$PASS" "$TASK_URL"
The task returns HTTP 201 for the valid POST, 400 for the POST with a missing field, 405 for the PUT, and 200 for the GET:
curl calls to the task endpoint returning HTTP 201, 400, 405, and 200 responses