Automations

Automations on Files.com allow you automate workflows on your Files.com site by automatically taking an Action when a Trigger occurs.

Automations are different from Folder Behaviors (Folder Settings) because Behaviors are associated with a specific folder, while Automations apply across your entire site.

Although Automations may have a Path specified, it can be a global (which includes wildcards), which affects multiple folders. Additionally, paths in Automations can refer to folders which don't yet exist.

Automations are never removed when folders are removed, while Behaviors are removed when the associated folder is removed.

Triggers

Automations can be triggered in the following ways:

  • Interval: Trigger the automation to run at midnight UTC based on the specified interval (Daily, Weekly, At the end of every week, Monthly, etc)

  • Custom Schedule: Trigger the automation to run at a user specified time, any day(s) of the week.

  • File Action: Trigger the automation when a file is created, read, updated, deleted, moved or copied from a selected folder.

  • Inbound Webhook: Trigger the automation will run when a request is received from another app via a webhook.

  • Realtime: Trigger the automation to run in Realtime based on defined conditions. I.e. whenever a condition becomes true, the automation will run. The Realtime trigger is currently only supported by the Request File and Request Move Automations. We plan to add support for this trigger to all Automation types. If you have a use case for the realtime trigger on an Automation that's not currently supported, please contact us and tell us more about your situation.

Future enhancements will allow Automations to be triggered by an incoming email, or by other services.

Please note that Files.com does not poll remote servers used in our Remote Server Mount feature for the purpose of firing Realtime and File Action-based triggers. Please consider our Remote Server Sync capability for realtime interoperability between Automations and Remote Servers.

Automation Types

There are currently six types of automations:

  • Create Folder

  • Delete File

  • Copy File

  • Move File

  • Request File

  • Request Move

Create Folder

Creates the folder with named by destinations in the path named by path.

Destination may include formatting parameters to insert the date/time into the destination name.

Example Use case: Our business files sales tax for each division in 11 states every quarter. I want to create the folders where those sales tax forms and data will be collected.

I could create a Create Folder automation as follows:

  • Trigger: daily
  • Interval: quarter_end
  • Path: /AccountingAndTax/SalesTax/State/*/
  • Destinations: %Y/Quarter-ending-%m-%d

Delete File

Deletes the file with path matching source (wildcards allowed) in the path named by path.

Copy File

Copies files in the folder named by path to the path specified in destinations.

If the parameter source exists, the automation will only fire on files matching the source (wildcards allowed).

If the parameter limit exists, the automation will only copy the newest limit files.

Move File

Moves files in the folder named by path to the path specified in destinations.

If the parameter source exists, the automation will only fire on files matching the source (wildcards allowed).

If the parameter limit exists, the automation will only move the newest limit files.

Request File

The Request File automation requests a file (optionally from a specific user) if it does not exist.

It requests the file named in the parameter destinations in the path named by the parameter path.

If the parameter source exists, the automation will only fire if a file in that path exists.

Destinations may include formatting parameters that are backreferences to the path.

Example Use case: Continuing our Sales Tax example from above, once the folders are created for the 11 states, our Bookkeeper needs to upload a .xlsx file containing the sales records for each state.

We can create a Request File automation as follows:

  • Trigger: realtime
  • Path: /AccountingAndTax/SalesTax/State/*/*/*/
  • Destinations: SalesByState-%p3-%p2-%p1
  • Group IDs: 123 (representing the Bookkeepers group)

The %p1, %p2 and %p3 are references back into the folder hierarchy (parent 1, parent 2, etc), so that the file will be named with the state name and the quarter name in the file. Example: SalesByState-NV-2017-Quarter-ending-Dec-31.xlsx

Now, let's say that our Tax Accountant is in charge of filing the actual state tax return once the Excel doc is completed by the Bookkeeper. We can create another Automation to let him know when it's his turn to operate:

  • Trigger: realtime
  • Path: /AccountingAndTax/SalesTax/State/*/*/%/
  • Source: SalesByState-%p3-%p2-%p1
  • Destinations: StateSalesTaxReturn-Unsigned-%p3-%p2-%p1
  • Group IDs: 124 (representing the Tax Accountants group)

So the accountant will take the excel from the bookkeeper, generate the state tax return, and then upload it as a PDF, ready for the CFO to sign. How does the CFO know when to sign? You guessed it, another Automation will let him know when it's ready:

  • Trigger: realtime
  • Path: /AccountingAndTax/**/
  • Source: *-Unsigned-*
  • Destination Replace From: -Unsigned-
  • Destination Replace To: -Signed-
  • Group IDs: 125 (representing the CFO group)

This Automation looks in every nested subfolder of AcccountingAndTax (that's the /**/ in the path). And it looks for any filename containing the filename string -Unsigned-. That's the cue to the CFO that something needs his signature.

Rather than specifying the exact destination filename, we can specify a Destination Replace From and To in order to generate the new filename from the old filename.

So if StateSalesTaxReturn-Unsigned-NV-2017-q4.pdf is uploaded, this Automation will trigger and expect the file StateSalesTaxReturn-Signed-NV-2017-q4.pdf from the CFO.

You could then put in place another rule for the Tax Accountant or Bookkeeper to go do the actual filing once a signature is in place.

Request Move

The Request Move automation requests that a file be moved. This is an alternate way to implement approval workflows.

A variant of the Request File automation, this Automation creates requests that a user or group move a file, presumably indicating that they've taken some action on it.

Example Use case: Action Verb uses Files.com to collect invoices from its Contractors, who upload new invoices into their own folder structure that only they have permissions to. That structure looks like this:

  • /Accounts Payable/Contractors/[contractor]/New/
  • /Accounts Payable/Contractors/[contractor]/Paid/

The contractor has full permissions to the New/ folder, but only read-only permissions to Paid/. This allows them to upload and update new invoices, but only view invoices that are already paid. (Cool!)

But, as we grow to dozens of contractors, it becomes a tough task for Accounts Payable to check all the New folders daily.

To ensure Contractors get paid timely, we might set up Request Move automation:

  • Trigger: realtime
  • Path: /AccountsPayable/Contractors/*/New/
  • Source: *
  • Destinations: ../Paid/
  • Group IDs: 126 (representing the Accounts Payable group)

Help us build the future of Automations

Do you have an idea for something that would work well as a Files.com Automation? Let us know! We are actively improving the types of automations offered on our platform.

List of Patterns That Can Be Used In Destination Filenames

When setting up Destination filenames in Automations, you may include pattern characters that will be substituted with values related to the Automation's run.

This is a reference of the available patterns to use for substitution.

These apply only if the Automation trigger is a File Action, and refer to the filename of the triggering File Action:

  • %tp - entire path of triggering File
  • %tf - filename of triggering File (without folder name)
  • %td - folder name of triggering File (without file name)

If the Automation trigger is an Inbound Webhook, any GET or POST parameters that are sent to that Webhook can be used by name. Parameters are limited to 190 characters in length each and 550 characters in length total.

  • %u-[GET or POST Param name] - will be replaced by the value sent in that GET or POST parameter to the Inbound webhook. For example, if the inbound webhook received parameter username, replacement pattern %u-username could be used.

These apply based on the source path of the Automation. Remember that source paths can include wildcard characters, so this is how you would convert those wildcards in the source into something meaningful in the destination.

  • %p1 - right-most folder component of matching source path
  • %p2 - second right-most folder component of matching source path
  • ... etc

These are always available and use the time associated with the run time of the automation. These values are similar to the values used by the strftime function in most standard code libraries.

  • %a - abbreviated weekday name (eg Mon)
  • %A - full weekday name (eg. Monday)
  • %b - abbreviated month name (eg. Jan)
  • %B - full month name (eg. January)
  • %C - century number (the year divided by 100, range 00 to 99)
  • %d - day of the month (01 to 31)
  • %e - day of the month (1 to 31)
  • %H - hour, using a 24-hour clock (00 to 23)
  • %I - hour, using a 12-hour clock (01 to 12)
  • %j - day of the year (001 to 366)
  • %m - month (01 to 12)
  • %M - minute (00 to 59)
  • %p - either am or pm according to the given time value
  • %r - time in am and pm notation
  • %R - time in 24 hour notation
  • %S - second (00 to 59)
  • %T - current time, equal to %H:%M:%S
  • %u - weekday as a number (1 to 7), Monday is represented as 1.
  • %U - week number of the current year, starting with the first Sunday as the first day of the first week
  • %V - The ISO 8601 week number of the current year (01 to 53), where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week
  • %W - week number of the current year, starting with the first Monday as the first day of the first week
  • %w - weekday as a number (0 to 6), Sunday is represented as 0.
  • %y - two-digit year without a century (range 00 to 99)
  • %Y - four-digit year including the century
  • %Z - time zone or name or abbreviation
  • %% - a literal % character

Get Instant Access to Files.com and Start Collaborating and Automating

The button below will take you to our Free Trial signup page. Click on the white "Start My Free Trial" button, fill out the short form on the next page, get your account activated instantly, and start setting up your Files and Workflows immediately.

Start My Free Trial