Workflows API

Process your files using Filestack Workflows.

Overview

Using Filestack Workflows you can build your desired workflows in your Filestack Developer Portal, configure their logic, and customize them related to your project.

When you complete building your workflow and its logic, you would have a Workflow ID, and using Filestack Workflows API, you can run your workflow on your files, and also receive its response in your web-browser URL.

The base URL of Workflows API is:

https://cdn.filestackcontent.com

Run Workflow

Using Filestack Workflows API you can run your workflow on your files using their handles or urls.

/run_workflow/

To run your workflow on your files using their handles or external URLs, you should run these URL templates in your browser or send a GET Request to them with the corresponding values.

  • Using File handles:

    https://cdn.filestackcontent.com/security=p:<POLICY>,s:<SIGNATURE>/run_workflow=id:<WORKFLOW_ID>/<FILE_HANDLE>
  • Using File URLs:

    https://cdn.filestackcontent.com/<FILESTACK_API_KEY>/security=p:<POLICY>,s:<SIGNATURE>/run_workflow=id:<WORKFLOW_ID>/<FILE_URL>
  • Using Storage Aliases:

    https://cdn.filestackcontent.com/<FILESTACK_API_KEY>/security=p:<POLICY>,s:<SIGNATURE>/run_workflow=id:<WORKFLOW_ID>/src://<STORAGE_ALIAS>/<PATH_TO_FILE>

In these templates, you should replace the following values with the ones you obtain in your Developer Portal:

FILESTACK_API_KEY string Your Filestack API Key.
POLICY string Filestack Security Policy.
SIGNATURE string Filestack Security Policy Signature.
WORKFLOW_ID string The ID you get after building your workflow in developer portal.
FILE_HANDLE string Filestack Handle generated after uploading your file.
FILE_URL string Your file URL.
STORAGE_ALIAS string Your storage alias.
PATH_TO_FILE string The path to your file in your storage.
Example Request
GET https://cdn.filestackcontent.com/security=p:eyJleHBpcnkiOjE1Nzc4OTk4MDB9,s:428c3b32063f2081ec1ee3a703d05ce19883849adb4c90224367fe9707b3d808/run_workflow=id:67d273c3-249c-4192-b228-9c3e1d003963/pR4oeS63QLmYIFNs2ZvZ

or

GET https://cdn.filestackcontent.com/At39kDB2eTYCbxuESgayWs/security=p:eyJleHBpcnkiOjE1Nzc4OTk4MDB9,s:428c3b32063f2081ec1ee3a703d05ce19883849adb4c90224367fe9707b3d998/run_workflow=id:67d273c3-249c-4192-b228-9c3e1d003023/https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png

or

GET https://cdn.filestackcontent.com/At39kDB2eTYCbxuESgayWs/security=p:eyJleHBpcnkiOjE1Nzc4OTk4MDB9,s:428c3b32063f2081ec1ee3a703d05ce19883849adb4c90224367fe9707b3d998/run_workflow=id:67d273c3-249c-4192-b228-9c3e1d003023/test_alias/test.png
Example Response
{
    "createdAt": "2019-10-24T20:50:38.695634422Z",
    "jobid": "7dba00f5-aee2-4f65-bd16-631e626b3c93",
    "sources": [
        "pR4oeS63QLmYIFNs2ZvZ"
    ],
    "status": "Started",
    "updatedAt": "2019-10-24T20:50:38.695634422Z",
    "workflow": "67d273c3-249c-4192-b228-9c3e1d003963"
}
Response Parameters
createdAt string Indicates the time when the workflow job was created.
jobid string The ID of workflow job that is processing your file.
sources list Array of strings which represent your file handles or URLs.
status string The status of your workflow job.
updatedAt string Last time the status of your workflow job has changed.
workflow string Your workflow ID that can be obtained from Developer Portal.

Workflow Status

Due to the fact that Workflows work asynchronously, first you need to send one request to run your workflow on your files, and then you can send another request to get its result back.

/workflow_status/

In order to get the final result of your processed files with your workflow, you should run this URL template in your web-browser or send a GET request to it with corresponding values:

https://cdn.filestackcontent.com/<FILESTACK_API_KEY>/security=p:<POLICY>,s:<SIGNATURE>/workflow_status=job_id:<WORKFLOW_JOB_ID>

In this template, you should replace these values with the ones you obtain from your Developer Portal:

FILESTACK_API_KEY string Your Filestack API Key.
POLICY string Filestack Security Policy.
SIGNATURE string Filestack Security Policy Signature.
WORKFLOW_JOB_ID string Your Workflow Job ID.
Example Request
GET https://cdn.filestackcontent.com/At39kDB2eTYCbxuESgEzEk/security=p:eyJleHBpcnkiOjE1Nzc4OTk4MDB9,s:428c3b32063f2081ec1ee3a703d05ce19883849adb4c90224367fe9707b3d888/workflow_status=job_id:5aef4e90-4c6c-4779-ac8b-289cff108792
Example Response
{
    "createdAt": "2019-10-24T20:59:41.345362491Z",
    "jobid": "5aef4e90-4c6c-4779-ac8b-289cff108792",
    "results": {
        "tags_1571950225779": {
            "data": {
                "tags": {
                    "auto": {
                        "abstract": 89,
                        "business": 90,
                        "circular": 90,
                        "color": 88,
                        "connection": 90,
                        "design": 97,
                        "desktop": 97,
                        "disjunct": 96,
                        "element": 92,
                        "graphic": 92,
                        "illustration": 95,
                        "image": 98,
                        "internet": 93,
                        "isolated": 91,
                        "round": 98,
                        "round out": 96,
                        "shape": 92,
                        "sign": 98,
                        "signalise": 93,
                        "symbol": 99
                    },
                    "user": null
                }
            }
        }
    },
    "sources": [
        "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"
    ],
    "status": "Finished",
    "ttl": 172800,
    "updatedAt": "2019-10-24T20:59:42.263798729Z",
    "workflow": "67d273c3-249c-4192-b228-9c3e1d003023"
}
Response Parameters
createdAt string Indicates the time when the workflow job was created.
jobid string The ID of workflow job that is processing your file.
results dictionary The JSON-formatted result of your workflow.
sources list Array of strings which represent your file handles or URLs.
status string The status of your workflow job.
ttl integer The total number of seconds that the result would remain in Filestack network.
updatedAt string Last time the status of your workflow job has changed.
workflow string Your workflow ID that can be obtained from Developer Portal.