Trigger a workflow with a file
  • 09 Jun 2023
  • 1 Minute to read
  • Dark
    Light

Trigger a workflow with a file

  • Dark
    Light

Article Summary

When using an on-demand trigger, you can create a File field, which accepts files for input. Any file you upload will be accessible only in Torq steps by using a non-shareable link that will be available in the trigger event. The user executing the workflow will be required to upload a file when running the workflow from Torq or when using the trigger form URL. You can also easily trigger a nested workflow using a file.

Important
Only users' locally stored files can be uploaded to the file field.

How to use

  1. Create a new workflow with an On-Demand trigger or use one that already exists.
  2. Add a trigger input parameter.Screenshot of adding the file parameter to the on-demand trigger.
  3. Select the File type and give the parameter a name. Specify whether the file is required or optional.Screenshot showing how to configure the file parameter.
  4. Add at least one step to your workflow and click Test Run.Screenshot of doing a test run for the workflow to test uploading a file.
  5. Upload a file to use during the workflow execution.Screenshot of uploading a file when prompted by the workflow.\
  6. The file link is available in the trigger event. The link is non-shareable and can only be used in Torq steps.Screenshot of accessing the file link.
  7. Use the file in the workflow steps. The file link is available at {{ $.event.<file parameter name> }}. To get the file content, use: {{ file $.event.<file parameter name> }}. The file inline function is required when accessing the file content since the link is non-shareable.Screenshot showing how to access and reference the file in subsequent steps.

Trigger a nested workflow with a file

You can pass a file URL to a nested workflow that has a file type trigger parameter. The nested workflow can also return a file URL as an output.



 IMPORTANT
Only non-shareable links that have the format tqfile://steps/XXXXXXXXX can be passed as trigger parameters.

Screenshot showing how to trigger a nested workflow with a file.


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.