Agent Compute (v2)
The Agent Compute node in Automations v2 runs a command on one of your On-Premise Agents for each incoming file and passes the command's result on as data. Use it to run a program that exists only inside your network, for example a validation tool, a legacy format converter, or a script that registers each file in an internal system, as one node of an Automation.
Agent Compute accepts file items, and it accepts data items by writing each one to a .json file first.
Settings
Remote Server selects the Agent that runs the command. Command is the name of an entry in the Agent configuration file's commands setting, matched exactly, including capitalization. The entry defines the executable and its command-line arguments on the Agent host. Command is static text and does not accept a TransformScript template.
Arguments supplies names and values for the entry's commands.schema parameters. Each value accepts a TransformScript template. For example, an argument named InputPath with the value {{ attributes.path }} supplies the incoming Files.com path to the Agent template {{.InputPath}}.
The command definitions are yours to maintain on the Agent host. This keeps approval of local programs with the host administrator, while Automation authors select the approved work and supply its inputs.
Restart the Agent after editing its configuration file. The Agent checks the command name when the command runs. Because that approval list is maintained on the host, Files.com cannot check the command when the Automation is saved; a command that is not on the list fails at run time rather than at save.
Agreeing on the Local Operation
Work with the Agent host administrator to define the operation and the inputs it accepts. The approved command name selects a local definition; its actual capabilities depend on the executable, scripts, arguments, and operating-system account behind that definition. An interpreter or script that treats an input value as instructions can perform more than the name of the command suggests.
Review both the values entered by Automation authors and values derived from incoming files or other workflow data. The host program must validate the inputs it receives, including any file paths, and keep them separate from executable instructions. The Agent configuration guidance explains how to pass script parameters and limit the local operation.
The Automation's Workspace controls which Files.com resources it can reference. Programs launched on the Agent use the Agent account's operating-system permissions. Neither the Workspace nor the Agent's file-transfer root and read/write settings restrict those programs' access to the host.
What the Next Node Receives
Agent Compute passes on one data item for each command it ran, containing the command's exit code as payload.exit_code, its standard output as payload.stdout, and its standard error as payload.stderr. A Transform node after it can parse payload.stdout.
Because a nonzero exit code fails the item, every item that continues on the main path has an exit code of 0. Standard output and standard error become Automation data in Files.com, so configure the program to return only information the workflow should receive, without credentials or unrelated file contents.
Errors
A command that is not approved on the Agent, or that exits with a nonzero code, fails that item. Error Handling rules on the node determine what happens to a failed item.