Skip to main content

Automations v2

An Automation is a workflow that runs on your Files.com site. It starts from a trigger: file activity in a folder, a scheduled time, an incoming email, a webhook call from an external system, or a manual start by a person or an API call. The run then passes files or data through a series of connected steps, called nodes. One Automation can receive a file, transform its contents, encrypt it, deliver it to two partners, and archive a copy, all in one run that records each node's result. You build the workflow as a graph of connected nodes, and run detail displays that same graph with each node's status.

In one workflow, a partner uploads a CSV of orders to an inbound folder. The Automation runs a TransformScript that converts the rows to the layout your bank requires, encrypts the result with the bank's GPG key, copies it to the bank's SFTP server through a Remote Server, and copies the original into a dated archive folder. A malformed file that fails the Transform node is moved to a quarantine folder instead, and the other files in the same run are still processed.

In another, Files.com receives an email with a ZIP attachment at the Automation's address. The Automation unzips the attachment, a Switch node evaluates the region field in each extracted file, and a Move File node moves each file to the folder for its region. A file whose region matches no rule is moved to a review folder.

In a third, every night at 2 AM the Automation selects the CSV files in each store's upload folder, moves each file into a dated processed folder, converts each moved file to XLSX in a dated converted folder, and sends the analytics team one email per converted file.

Automations are one of several Files.com features that move and process files. If you are not sure an Automation is the right fit, see Comparing Automations to Related Features below.

What an Automation Is Made Of

Every Automation has one trigger, which defines when a run starts and which files or data it starts with. The files and data the nodes process are called items. Every other node is an action or a control.

You connect the nodes into a graph. The graph is a chain when each node follows the one before it, and it branches when one node's output is connected to two nodes or when an If or Switch node routes each item to one path.

Triggers

The trigger is the first node in the graph and the only node that receives no items from another node.

TriggerWhat starts the run
ScheduledRuns on an interval or on chosen days and times, with an optional folder path and file pattern to select the files to process.
ManualRuns when a person or an API call starts it, on the files selected by its folder path and file pattern, or on the files or data supplied in the API request.
File ActionRuns when selected file actions occur in a folder you choose.
WebhookRuns when an external system sends JSON to the Automation's webhook URL. The request JSON becomes the run's input data.
Incoming EmailRuns when Files.com receives an email at the Automation's address. The attachments, and optionally the message body, become the run's input files.

Actions

Actions operate on the files or data they receive and pass their results to the next node.

ActionWhat it does
Create FolderCreates folders at the paths you configure.
Copy FileCopies each incoming file to one or more destinations.
Move FileMoves each incoming file to one or more destinations.
Delete FileDeletes each incoming file.
Import FileDownloads a file from a URL into your site.
Run SyncRuns the Syncs you select, once for each incoming item.
Send via AS2Sends each incoming file to an AS2 Partner through an AS2 Station.
Send EmailSends one email per incoming item, with optional attachments, through your Custom SMTP server.
Agent ComputeRuns a command approved in an On-Premise Agent's configuration for each incoming file and returns the result as data.
Set MetadataReplaces the custom metadata on each incoming file with the values you configure.
ExtractExtracts text and metadata from each incoming file, adds them to the item's attributes for later nodes, and does not change the file.
Convert DocumentConverts documents, spreadsheets, and presentations to another format.
Convert ImageConverts images to another format and optionally resizes them.
ZipCombines the incoming files into one ZIP archive.
UnzipExtracts the files inside each incoming ZIP archive.
Encrypt With GPGEncrypts each incoming file with a key from your GPG Key Manager.
Decrypt With GPGDecrypts each incoming file with a key from your GPG Key Manager.

Controls

Controls route, filter, combine, delay, or transform items. Transform is the only control that writes a file itself, and only when you set a destination.

ControlWhat it does
IfRoutes each item to the True or False path based on one condition.
SwitchRoutes each item to the first path whose rule matches, or to the Default path when none does.
FilterPasses items that match a condition to the next node. Items that do not match are not processed further on this path.
JoinCombines items from two inputs into data items by matching key values.
AggregateCombines all incoming data items into one data item.
WaitDelays items for the time you set, then passes them to the next node.
TransformRuns a TransformScript on each item and outputs data, or a file when you set a destination.
Run AutomationRuns another Automation with the incoming items and passes its returned items to the next node.

Building an Automation

You build an Automation in the Builder, which displays the workflow as a graph with the trigger at the top and each node beneath the node that supplies its input. You choose the trigger first, then add nodes and configure each one. The Builder computes the layout, so there are no positions to manage, and the same graph is always displayed the same way.

Each node shows which kinds of items it accepts and produces. When you add a node, the Builder shows which node types accept the item kinds the previous node produces, and it flags any node whose configuration is incomplete. Files.com validates the whole graph when you save it, and an invalid graph is not saved.

Every Automation is a JSON definition of its trigger, nodes, and connections. You can view and edit that definition in the Builder, and you can create, update, and run Automations from your own code through the Files.com API. Files.com also integrates with Boomi, MuleSoft, Zapier, and Power Automate and Azure Logic AppsExternal LinkThis link leads to an external website and will open in a new tab, for teams that already run their workflows on one of those platforms.

Items, Branches, and Error Paths

Each node receives items from the node before it and passes items to the node after it. An item is either a file, identified by its path, or data, which is a JSON object.

The trigger produces the first items. A File Action trigger produces the files that triggered it. A Webhook trigger produces data from the request body. A Scheduled trigger with a folder path and file pattern produces the matching files.

Every node processes every item it receives, and some nodes change the number of items. Zip combines many files into one archive, Unzip extracts one archive into many files, and a Transform that returns a list converts one item into one data item per list element.

Connecting two nodes to the same output sends the same items to both, and both branches run in parallel. An If or Switch node routes each item to exactly one of its paths. A node whose inputs are all empty is Skipped rather than failed.

Every node after the trigger has an Error path. The node's Error Handling rules determine whether a failed item is routed to the Error path or is not processed further. On the Error path, a Move File node can move the failed item to a quarantine folder. Without an Error Handling rule, a failed item is not processed further, and the other items in the run are still processed.

TransformScript in Automations

TransformScript lets node settings reference the items in the run. In a destination path such as archive/{{ attributes.name }}, the expression is replaced with each file's name at run time. An If condition such as payload.amount > 1000 evaluates a value from the current item. A Transform node runs a complete script. For a file item, payload is the parsed file contents and attributes contains the file's name, path, and other recorded details. For a data item, payload is the object itself. TransformScript in Automations lists every field that accepts an expression and what the expression in each field can read.

Ownership

An Automation belongs to your site or to a Workspace, never to a person. It runs with its owner's permissions, so it continues to run if the user who built it is disabled or deleted, and a Workspace-owned Automation cannot access files outside its Workspace. Folder Admins, Workspace Administrators, and Site Administrators can create, edit, and run an Automation.

Runs and Revisions

Each run's run detail records the graph as it was when the run started, every node's status, the items each node received and produced, and a journal of events. Every saved change to an Automation's graph creates a new Revision, and a run uses the Revision it started with. Run Logs lists an Automation's runs, and each row opens that run's detail, where you can cancel a run while it is running and rerun a finished run from any node. When a run fails or partially fails and retries are enabled, the new run resumes from the first failed or partially failed node and reuses the output of the nodes that completed.

Common Patterns

Beyond the three workflows above, customers write values extracted from files to metadata and route files by those values, and they define a delivery sequence once and run it from several Automations with Run Automation. Each of these patterns is built node by node in Example Workflows.

To convert Automations created before multi-step Automations were available, follow Migrating Automations v1 to v2.

Sync, Folder Settings, Expectations, and AI Tasks overlap with Automations in different ways.

Automations vs. Sync

A Sync replicates a folder to a folder in another location, in one direction, on a schedule or when an Automation starts it. It copies files that are new or differ in size and skips the rest. It selects files only by include and exclude patterns, it has no branches, and it does not change what is inside a file.

Use a Sync when the job is replicating a folder. Use an Automation when files need processing, or when the destination depends on a file's name or contents. A Run Sync node lets an Automation start a Sync as one of its nodes, so a workflow can process files and then start the Sync that delivers them.

Automations vs. Folder Settings

A Folder Setting applies one rule to one folder, and some settings also apply to its subfolders. It runs the same way for every file and is removed when the folder is deleted. Use a Folder Setting when a single rule belongs to a single folder. Use an Automation when the rule applies to many folders, depends on a condition, or is one node in a longer workflow. Automation paths can also reference folders that do not exist yet.

Automations vs. Expectations

An Expectation monitors for expected deliveries and reports the ones that do not occur. With Content Validation, it also validates file contents against rules you write, without changing the files. An Expectation opens an Incident when a scheduled delivery does not arrive or does not pass its checks. Use an Expectation to confirm that a partner delivered the file on time and that it passed its checks, and an Automation to process the file.

Automations vs. AI Tasks

An AI Task runs Files.com AI on a schedule, when file activity occurs, or when an administrator starts it, to review a document, audit permissions, or evaluate anything else that a fixed rule cannot. An Automation runs the same nodes every time. Combine them by having an Automation move a file to a staging folder, an AI Task review it, and another Automation deliver it.