Skip to main content
Skip table of contents

How-To: Upload a Local File

Overview

In this tutorial, you'll learn how to upload a file from your computer to Workflows that can be used in a Workflow. This can be helpful to upload static credential or reference files, such as RSA keys.

By the end of the tutorial, you'll be able to:

We do not recommend using this process to upload dynamic data files. We recommend that you download data files using our Library Templates.

Setup

First, download this zip file, named upload_rsa.zip to your computer without making any changes.

Feel free to peruse this zip file beforehand so you understand the contents and purpose. The zip file contains two files:

  1. upload_rsa.sh - A bash script that prints a success message and returns a 0 exit code.

  2. id_rsa - The RSA key file to be uploaded into Workflows.

Steps

Using the sidebar, click + New Workflow. You'll now be on the Workflow builder canvas. Next we'll walk through the process of building the required Task to upload the file to Workflows

Step 1 - Create a Code Task

  1. Click Bash under the Code Tasks dropdown.

  2. Under Task Name, enter Upload RSA File.

  3. Under the Code dropdown in the File to Run input, type upload_rsa.sh.

  4. Click the Upload toggle option.

  5. Click the Upload File button and select the upload_rsa.zip downloaded in the Setup section above.

Vessel Setup

When you upload files to Workflows using this method, they will be automatically unzipped. Only a single specified file (in this tutorial, upload_rsa.sh) can ever be run per Task. Future downstream Tasks can run and access the files in the zipped file.

Step 2 - Create a Task to Check Workflows File System

  1. Click the Add Task button to add a second Task.

  2. Click Bash to add a Bash code Task.

  3. Under Task Name, enter List All Files.

  4. Under File to Run, enter list_files.sh.

  5. Under Code, enter ls -laR.

  6. Connect the Upload RSA File and List All Files Tasks.

Step 3 - Name your Workflow

  1. Click the cog for Workflow Settings on the left side of the Workflow Builder.

  2. Under Workflow Name, enter Upload RSA File to Workflows.

  1. Click Save & Finish on the bottom right corner of your screen. This will redirect you to a page that lets you know that your Workflow has been created successfully.

  1. Click Run Your Workflow. This will redirect you to the Workflow Log page.

Step 4 - Check for your File

  1. Wait for your Workflow to complete running with a status of Success.

  2. Click the green rectangle for the List All Files Task.

  1. This takes you to the Task Log.

  2. You are able to see the id_rsa file that we wanted to upload from our computer in the Workflows file system.

You have successfully created a Workflow with a Task that can upload a file to use in Workflows from your local file system.

Use this process in any of your own Workflows by connecting the "Upload Local File Task" before another Task.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.