Skip to main content

01.2 How to send Data into a Scenario

In addition to running a scenario, it may be necessary to send data into the scenario for further processing. Data can be passed in the body of a request (e.g., a POST request) to the URL of a Trigger on Webhook node.

Most often, you'll need to pass JSON objects or various files into the scenario.

A tool for sending POST requests, for example, can be Postman.

Send JSON Objects

To send JSON using Postman to a Trigger on Webhook scenario node, follow these steps:

  1. Create a scenario containing the Trigger on Webhook node;
  1. In Postman:
  • (1) Select the request method, such as POST;
  • (2) Specify the URL of the Trigger on Webhook node as the request target;
  • (3) Go to the Body tab and select the Raw format for file transmission;
  • (4) Choose the JSON format for the request body;
  • (5) Add text in JSON format;
  1. Save and activate the scenario with the Trigger on Webhook node and, if necessary, click Run Once;
  1. Send a request containing JSON.

As a result, the JSON will be transmitted into the scenario, and the output data of the Trigger on Webhook node will be the parameters of the transmitted JSON object or an array of objects, such as id, gender, and so on.

Send Files to a Scenario

To send files using Postman to a Trigger on Webhook scenario node, follow these steps:

  1. Create a scenario containing the Trigger on Webhook node;
  1. In Postman:
  • (1) Select the request method, for example, POST.
  • (2) Specify the URL of the Trigger on Webhook node as the request target.
  • (3) Go to the Body tab and select the format for file transmission as Form-data.
  • (4) Define the key Key and the required format as file.
  • (5) Add the file as the Value.
  1. Save and activate the scenario with the Trigger on Webhook node and, if necessary, click Run Once;
  1. Send a request containing the file.

As a result, the file will be transmitted into the scenario, and the output data of the Trigger on Webhook node will include parameters of the file, including its name, size, and content.

The content, in particular, is the main attribute of the file, and often, this attribute is what needs to be specified in the fields of other nodes.