Create a custom step
  • 13 Dec 2023
  • 6 Minutes to read
  • Dark
    Light

Create a custom step

  • Dark
    Light

Article Summary

Torq has hundreds of vendors and steps out of the box, but sometimes it's useful to create a custom step from scratch yourself for testing purposes or to work with a service that does not have a public API. For these cases, you can quickly create custom steps. There are several ways to create a custom step:

Create an HTTP request step

  1. Go to the Workflows page and either open an existing workflow or create a new workflow.

  2. In the Steps Library, search for Send an HTTP Request and add the step to the designer.

  3. Click the wand icon, which will open the step builder.

  4. Complete the step wizard. See below for more information on the step wizard.
    It’s important to save the work you do in the step wizard. If you close the wizard without saving, all work on the custom step will be lost.

  5. To use this step later, you can select it from the Custom Steps section in the Steps Library.

Create a custom step from a public step

In most cases, you’ll want to create a custom step from a public step, not convert to HTTP mode.

  1. Add or locate the step you want to customize.

  2. In the step configuration window, click the wand icon.

  3. Complete the step wizard. See below for more information on the step wizard.
    It’s important to save the work you do in the step wizard. If you close the wizard without saving, all work on the custom step will be lost.

Convert a step to HTTP mode

HTTP mode exposes additional HTTP request options for an integration step. Since integration steps are usually a subset of the integration's API calls' input parameters, Torq gives you the ability to open an integration step in HTTP mode to configure the step as a raw HTTP request. This enables you to use the full functionality of the underlying API request.

Example: Get member list Dropbox step

The only parameter the Get member list Dropbox step has is the integration.

Click Switch to HTTP mode

Click the two arrows icon to convert the step to HTTP mode. Now you can edit the API call to suit your needs.

Edit the api call

For example, you can provide a different access token than the one used by the integration. The out-of-the-box step can use only the access token provided by its only input parameter - the Dropbox integration.

Use a custom access token

Create a step from a cURL command

Create an HTTP request step by pasting (similar to copy-paste) an API call in the form of a cURL command (for example, from vendor documentation) in the designer.

  1. Copy the cURL command that executes the API call you want to run in Torq.

    curl -X GET "https://api.shodan.io/shodan/host/8.8.8.8?key={YOUR_API_KEY}"
  2. In the designer, paste it onto the desired anchor (the same way you would paste a step).

  3. An HTTP request step is created based on the cURL command.

  4. If you want to further customize the step, click the wand icon and complete the step wizard. See below for more information on the step wizard.

wtq79n2y4cil8kibpzs9upy2wrwnhwr2p1o6p7dwgxa83djn42bhd3ywe621mwwm

Create a step from a nested workflow

Save nested workflows as custom steps to allow other users to easily access, reuse, and benefit from their complex logic. For more information on nested workflows, see here.

  1. Within an existing workflow, drag the Workflow operator onto the designer. 0tsfas28imo5siap5e8v3rjsb7oeig9itx8b5749eytpzic14k2m8rh0arv7i17w

  2.  Select the workflow you would like to save as a custom step. Note: this must be a workflow you can access within your tenant. nwji5cs2lll25dw7h6mo00g2pa7pgy2mva1kabvv98dtec7yzhy6isai5nvbsn68

  3.  Click on the wand icon to create a custom step based on the selected workflow.

  4.  Give the step a unique and relevant name. 

    • Choose the main vendor for this nested workflow - this will ensure the custom step appears when you search for that vendor. 

    • You can also specify the name of an entirely new vendor, along with a URL for a new vendor. 

      q3eyue3flouq4x09kvx57sr54gnk08o7btx13yhr40i5spiw2b0992dei1t2e05v
  5. Click Create. The new step will now be available in the Custom Steps section in the steps library. 

36oh39szum2ari2o6l6t9xgc6ouwxr82rozuscbrqubm5poajmk5ycbye9k0uco0
895gmxai7cmssmbwk7y02j6rdt2pdmp8usihvyabwmbgvs36nb9jjqwdny294u6h

Step builder

Here’s a quick walkthrough of the step builder.

Save

It’s important to save the work you do in the step wizard. If you close the wizard without saving, all work on the custom step will be lost.

Step details

  • Name: A meaningful name for the step. Make sure other users will be able to understand what it does.

  • Description: A brief explanation of the step that expands on the name.

  • Documentation URL: A link to the vendor’s API documentation (if available).

  • Vendor: The vendor for this step. If the vendor doesn’t exist, you can type the new vendor name and click Create <vendor name>B.

  • Integration (optional): The integration instance to use by default for this step.

HTTP request

In this section, you create the underlying API for the step.

  • URL: The base URL for the API call.

  • Method: The API method (GET, POST, PATCH, DELETE, etc.).

  • Authorization: The authorization method for the API call (None, Basic (u/p), and Bearer.

  • Headers: One or more key:value pairs that further secure the Webhook.

  • HTTP optional parameters: An expandable list of optional parameters to add to the step.

Parameters

You can use any value from the HTTP request and make it a parameter. This means that when a user is configuring this step, they’ll see the parameter as a field (on the main configuration window if required, and available from the cog wheel icon.

How do I select a value to become a new parameter?

For a new parameter, highlight the value and click Set as parameter. The value will be marked, and the parameter will be added on the left-hand side for you to configure. You’ll see the step preview will show the input field of the step for this parameter:

How do I assign a value to an existing parameter?

Highlight the value and select the ‘Assign to existing parameter’, then select the desired parameter from the list:

What types of parameters can I create?

There are primarily two parameter types, data parameters, and integration parameters.

  • Data parameter
    This is a parameter that will receive input from the end-user using the step. The user should edit the name to be a pretty name for the step’s input field (the preview will be updated accordingly), select the correct type, description, placeholder, and if this is a required field:

  • Integration parameter
    If the step was configured with an Integration (under the Step details section), the user can select that a parametrized value will receive its content from the Integration. This will usually be for the account domain identifier in the URL or for the authorization-related values.

What is a parameter condition?

This is a regular parameter that should be used in case a parameter should be filled by the end-user of the step if another parameter was filled in a specific value or at all. In the step configuration, the user should unselect the ‘Required’ checkbox and add a condition according to the correct needs:

Can I remove a value from a parameter?

To remove a value from being a parameter (but not delete the parameter), go to the HTTP section, click on the parameterized value, and click Remove parameter.

If the parameter doesn’t have any value assigned to it a notification will appear, reminding you to assign a value or delete it.

How do I delete a parameter?

To delete a parameter, go to the parameter configuration and click Delete in the top right corner of the configuration. When deleting a parameter, each associated value will become unparameterized, and the input field presented in the step itself (preview) will be removed.


Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.