API User's Guide

Invoking global workflow functions

Introduced in 2025

This article explains how to execute global workflow functions via API. Unlike actions with database objects (see Working with Alloy Navigator database objects), which require an object context (e.g., Ticket ID, Asset ID), global functions are context-free - they execute independently and are not bound to any specific object.

HTTP method

POST

API URL
http://www.example.com/api/function/{functionId}

where:

  • functionId is the ID of the global workflow function to execute, such as http://www.example.com/api/function/245
Request body format

The body of the request can include values for input parameters defined in the function.

Parameters are provided in the form of a JSON object, where:

  • Keys are parameter names (Param_*)

  • Values are parameter values.

NOTE: Parameters of type ObjectScript are not supported.

If a parameter of type Attachments is defined, its value must be an array of attachment objects. Each attachment must include:

  • FileName: Name of the uploaded file.

  • Description: Optional user-readable comment.

  • Data: Base64-encoded file content.

Response format

After execution, the API returns a JSON object with the outcome of the function call as follows:

{
				"success": true,
				"errorCode": 0,
				"errorText": "",
				"responseObject": {
				"Succeed": true
				}
		}
Examples
Example 1: Regular parameters only

This example demonstrates calling a global function that finds and closes all resolved tickets that were resolved more than X days ago (e.g., 30 days).

Let's assume that the global function's ID is 1257. The function supports configurable day threshold via the Param_DaysThreshold parameter. It also allows inserting an optional note into each ticket adding via the Param_Comment.

To execute this global function, you will run POST http://www.example.com/api/function/1257 with the following request body:

{
				"Param_DaysThreshold": 30,
				"Param_Comment": "Automatically closed due to inactivity."
				}
		}
Example 2: Using file attachments

To add attachments, include the Attachments array in the request body in addition to the other field value pairs, as follows:

{
	"Comment": "New activity",
	"Attachments": [
		{
			"FileName": "hello.txt",
			"Description": "Sample file",
			"Data": "SGVsbG8h",
			"AttachmentArea": "Documents"
		}
	]
}

where:

  • AttachmentArea - the attachment area name in the action form's definition. If the action form has only a single attachment area, you can omit AttachmentArea.