ATC: CALL [scriptname or GUID or $variable]
ATC: INVOKE [scriptname or GUID or $variable]

The CALL command runs a workflow script from the Workflow Script tool. When the called script finishes, execution of the calling script resumes (unless the called script causes errors).

INVOKE runs the script with elevated “system” level permissions.  For security, this command can only be used in a script in a Workflow Library (not a route script).   If you require a ROUTE workflow, first use ATC: CALL to run a script in the library/tool, then have that script use ATC: INVOKE to elevate permissions. Permissions are restored when the invoked script returns.

  • [scriptname or GUID or $variable] is required. It specifies either a workflow script that exists in the system’s Workflow Script library, either by name or by GUID, or a variable name that contains the name of the workflow script. Square brackets are required.
Recursion

Recursive calls are possible to a maximum call depth of 1024.  Each document has its own call stack.

Scope of Variables

Variables are global references, meaning:

  • All $ variables are accessible to the called script.
  • If the called script changes a $ variable, the new value is retained when the call has completed

Examples:

ATC: CALL [OutForBid]

The above example means “run the workflow written in the OutForBid script, as created in the Workflow Scripts tool.”

ATC: SET $NewStatus = W
ATC: SET $CallNext = OnNewCharge_Subtype_[DocHeader_SubType]
ATC: CALL $CallNext
ATC: SET STATUS = $NewStatus

The above example means “store a W into the $NewStatus variable, then store the name of a workflow script that includes the subtype of the document into $CallNext (for example, OnNewCharge_Subtype_PO), then call that workflow script and set the new status to W.”
Note: if the called workflow changes the $NewStatus variable to something other than W, the status would be changed to that new status and not W.

ATC: INVOKE [ApprovePayment]

The above example means “run the workflow written in the ApprovePayment script, as created in the Workflow Scripts tool.  Run the script with SYSTEM level permission, and reverts to user permissions upon return. ”   See a full example:

  • KBA-01876   Using Workflow to Approve Docs (regardless of permission)

 


Last updated: July 21, 2025 at 19:49 pm;  

Related Post

ATC: EXIT LOOPATC: EXIT LOOP

ATC: EXIT LOOP This command exits the current ATC: FOREACH loop. It is usually used within an ATC: IF block. Example ATC: FOREACH DocAttachedFile BY CheckOutStatus WITH CheckOutStatus <> 'H'

ATC: ROUTEATC: ROUTE

ATC: ROUTE routelist; option This command alters the route of the current document. routelist is required. It specifies the routing to be applied to the document. The routelist can contain

ATC: ADD COMMENTATC: ADD COMMENT

ATC: ADD COMMENT description This command adds a comment/remark to the current target document. description is required. The freeform description can be any text and can include spaces Note: to format