run

With the use of this filter you can run any other scripts that you have set up. Additionally you can pass a JSON objects with parameters. These parameters will be preloaded to task you would like to run.

Script will be executed asynchronously.

This filter is particularly useful when using Blank HTTP task. You can run any other task and respond with 200 code to acknowledge receipt of a message.

{% if request == blank %}
    {% json request %}
        {
            "body": {}
        }
    {% endjson %}
{% endif %}

{% capture task_input %}
    { "recieved_inventories": {{request.body | json }} }
{% endcapture %}

{{ task_input | run: "update_inventory_levels" }}
{% json response %}
    {
        "status": "ok"
    }
{% endjson %}

Placing above snippet in any Blank HTTP task would trigger a task identified with handle: update_inventory_level

Instead of script handle you can also use Script ID

Last updated