Skip to content

Endpoint Tasks

Introduction

Tasks are the bread and butter of AireGlu Endpoints. There are a number of included Tasks you can use, or you can write your own adapters to create custom tasks.

HTTP Request

The HTTP Request task is used to communicate with external services. You can use this to send data to your APIs, or fetch data from other sources.

HTTP Response Handler

The Response Handler can only be used when linked to an HTTP Request. This handles what is returned from the request (e.g. the data from your API). You don't have to include this if you don't care about the result of your request, but more often than not the two come as a pair.

MESH Message

The MESH Message task lets you create and send mail via the MESH workflow system.

Email

The Email task allows you to send an email. This can be sent from your own email servers, or from AireGlu's default email server.

SMS

The SMS task allows you to send text messages using either the MessageBird or GOV.UK notify services

Job

The Job task allows an endpoint to be run at a specified time or interval, much like a scheduled task or cron job.

Fax

The Fax task allows you to send a message or PDF to a Fax machine. A PDF is required and can be part of your input data.

HTTP Response

Lets you specify an HTTP response that the Endpoint should return as its result.

HTTP Redirect

Lets you specify a redirection that should occur as the result of the Endpoint. Useful for sending the user to a "Thank you" page for instance.

Mapping

The Mapping task is for data transformation. It can be used to reformat the data, or modify it in the pipeline. The output of this can be used in any subsequent tasks.

PDF

The PDF task lets you return a PDF document as the result of the Endpoint.

JWT

The JWT task allows you to generate a JWT with customisable headers & payload, with a choice of encryption and/or signing algorithms.

Audit

The Audit task generates logs and sends them to AireAudit. To view these logs you can navigate to AireAudit. Here you’ll be prompted to sign in, and once logged in, you’ll see a list of audit logs which you can apply filters on.

Task Configuration

Context Data

The Context Data panel is found on the left-hand side of mapping tasks and provides access to dynamic data, variables, functions, and secrets for building your endpoint logic.

Paths

Paths, provide access to the input data that was originally sent in to the endpoint, and the outputs of any Mapping tasks and from HTTP Response Handlers. Changing the Data Origin field allows you to choose between available data sets.

Data Tree View

The default Data Tree tab displays your available data in an expandable tree structure:

  • Data Origin: Select between available data sets using the dropdown (e.g., "Input" for the original request data)
  • Tree Navigation: Expand objects and arrays to explore the data structure
  • Preview Values: Click the eye icon next to any field to see a preview of its value
  • Insert Paths: Click the arrow icon to insert the JSON path into your mapping

data tree

Path View

Switch to the Path View tab to create custom path mappings:

  • Add Custom Paths: Enter a custom path key and specify the full JSON path (e.g., $.bookstore.socialMedia.instagram)
  • Manage Paths: Edit or delete existing custom paths using the action icons
  • Reusable Mappings: Custom paths appear in the "Existing Paths" list for easy reuse across your mapping

data tree

Using Paths

You can reference data in two ways:

  1. Drag and Drop: Drag any field from the data tree directly to where you need it in your mapping
  2. Click to Insert: Click on your destination field, then click the arrow icon next to the desired data path to insert it

All paths generate the appropriate JSON (or XPath if the data is in XMML format) path syntax automatically, making it easy to access nested data structures in your endpoint responses.

data tree

Example Path Editing

Sometimes the default paths created by AireGlu may need some fine tuning - for instance if the document order of the source data cannot be guarenteed or if you have an array of key value pairs.

data tree

In this example for the --*summary*-- field the default JSONPath mapping provided by AireGlu was $.buildingBlocks[2].controls[0].values[0].value.

However to avoid any brittleness arising from changes to the document order and ensure the path mapping is generally more robust you can use the path editor to ensure you are selecting exactly the right data (in this case using JSON path predicates) - for instance your JSONPath might be updated to $.buildingBlocks[?(@.key=='respect-35-section-2')].controls[?(@.id=='diagnosis')].values[0].value

data tree

Functions

Functions, provide built-in AireGlu utilities for data transformation and processing. These functions can be used to perform common operations like encoding, date formatting, generating unique identifiers, and more. Use the search box at the top of the Functions panel to quickly find specific functions by name or functionality. Inserting Functions

Available Functions

The Functions panel includes a comprehensive library of built-in functions:

  • DateTime: Gets the current UK date + time and allows you to supply formatting. You can use --*AG:DateTime(dd-MM-yyyy:HH:mm:ss)*-- to return something like 23-10-2025:14:01:17. If you don't supply formatting you will get the date and time returned with the following format 10/23/2025 2:01:17 PM
  • UUID: Generates a unique GUID. Using --*AG:UUID()*-- will return something like 752159eb-4b5c-46f6-8075-940d86f3cfec
  • Random: Generates a random number with customisable ranges. For example --*AG:Random(1, 100)*-- would return values such as 1, 11, 53, 95, 100 etc.
  • OID: Generates an object identifier with the ability to add a custom prefix. --*AG:OID()*-- would give you something like .16119148528986018192686031671488659480 and --*AG:OID(test-prefix)*-- would give you test-prefix.46956660880318974376026675650154157887
  • Base64Encode: Encode strings or streams to Base64 format. Can be called like so: --*AG:Base64Encode(test-string)*-- to get a result of dGVzdC1zdHJpbmc=
  • Base64Decode: Decode Base64 strings back to original format. Calling --*AG:Base64Decode(dGVzdC1zdHJpbmc=)*-- would give you the result test-string
  • UrlEncode: URL-encode strings for safe transmission. --*AG:UrlEncode(isn't it)*-- would result in the ' and the space being encoded like so: isn%27t+it.
  • Raw: Pass through data without transformation. For example, if your mapping output was in JSON format, this function can be useful to prevent JSON transformation from taking place for special characters. An example would be where you have a path value-to-encode with a value of O'Brien, you can use --*AG:Raw(--*value-to-encode*--)*-- to result in O'Brien instead of transforming to O\u0027Brien. Please see the Useful Information section for more examples of how this can be useful to use with other functions like UrlEncode.
  • JWT: Create JSON Web Tokens with RSA key signing. --*AG:JWT({RSA_SIGNING_KEY}, {CLAIMS_AS_JSON_STRING})*-- will result in a JWT being created which will contain the supplied claims e.g. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30. Ideally you would store the RSA key as a secret and when trying to preview this you will get [JWT token] returned back instead of the JWT itself in the preview window.

Useful information

One thing to watch out for is if you supply a path token which contains a value with special characters e.g. path value-to-encode with value of O'Brien and supply this to a function like so: --*AG:UrlEncode(--*value-to-encode*--)*--, it will actually attempt to transform the path value initally resulting in the value O\u0027Brien if the output mode is JSON. In the UrlEncode example, this value will then get URL encoded to give you O%5cu0027Brien. If you would rather skip this initial transforming to O\u0027Brien then you must use the Raw function at the same time like so --*AG:UrlEncode(--*AG:Raw(--*value-to-encode*--)*--)*-- to give you a result of O%27Brien. The same behaviour exists for a liquid expression too, in this case

--*AG:UrlEncode({{ input.value-to-encode }})*--

would give you a result of O%5cu0027Brien, whereas:

--*AG:UrlEncode({{ input.value-to-encode | raw }})*--

or

--*AG:UrlEncode(--*AG:Raw({{ input.value-to-encode }})*--)*--

will give you O%27Brien.

Another thing to note, by default when using paths or liquid expressions, the values returned will be transformed if used in a textbox/textarea which has an output format setting. This output format will determine what transformation takes place and ultimately what value is returned. Using the value-to-encode with value of O'Brien example above this would give us a transformation of O\u0027Brien for JSON, O'Brien for XML/HTML, O%27Brien for Query String, and simply O'Brien for Text. However, this won't be the case for variables or secrets. In the case of variables and secrets, the values will not be transformed and will always resolve to the exact text value that was supplied. Therefore, if you had a variable of O'Brien, the value returned would still be O'Brien regardless of the output mode selected. If, for example, you wanted to have a JSON transformed value you would need to create a new variable with the value explicitly set as O\u0027Brien.

Below shows various examples of the value-to-encode path and value-to-encode-variable variable being used with an XML based mapping task and functions. xml mapping task with functions

Using Functions

Functions can be configured in two ways:

  1. Hard-coded Values: Enter static values directly into the function parameters
  2. Dynamic Templates: Use paths, variables, or secrets as function inputs by templating them into the parameters

Inserting Functions

  • Drag and Drop: Drag any function from the list directly to where you need it in your mapping
  • Click to Insert: Click on your destination field, then click the arrow icon next to the desired function

In the examples shown:

  • Base64Encode: Encoding content like --name-- (a templated path reference) into Base64 format
  • Templated Base64Encode: Using --AG:Base64Encode(--name--)-- to encode dynamic content from the name field

The preview panel shows the real-time execution of these functions, demonstrating how they transform your data in the actual endpoint output.

data tree

Secrets

Secrets, let you add private data to your requests. This data cannot be seen once created, so is suitable for things like authentication details. You can use these either by dragging the required field to the left hand side where you need it, or by clicking to the destination point and hitting the arrow. You can read more about Secrets here.

The panel includes a search function at the top to help you find specific secrets quickly.

Secrets are particularly useful for templating sensitive information into your endpoint configuration, such as:

  • Authorization headers (as shown in the image with Bearer --audit-bearer-key?--)
  • API keys
  • Authentication tokens
  • Other credentials that shouldn't be hardcoded

This approach keeps sensitive information secure while still allowing you to reference it in your endpoint configuration.

Using secrets instead of hardcoding sensitive values improves security and makes credential management more flexible within your Airglu workflows.

secrets use

Variables

Variables are tenant-wide settings that provide common data that can be reused across multiple endpoints. Unlike secrets, variables are visible and editable, so they should only contain non-sensitive information. You can use variables by either dragging them from the list to where you need them in your mapping, or by clicking on your destination field and then clicking the arrow icon next to the variable. You can read more about Variables here.

The panel includes a search function at the top to help you find specific variables quickly. Each variable in the list has an arrow icon that allows you to insert it into your selected field.

This provides quick access to all variables that can be mapped into your endpoint configuration.

Editor

Preview

The Preview panel on the right side shows you the output of your task. It can help you verify your mapping logic works correctly before saving your task. This collapsible panel can be toggled on and off using the "Display Preview" switch in the top-right corner.

The preview executes your mapping logic using sample data to show you exactly what your task output will look like. It processes:

  • Dynamic Data: References to input data and previous task outputs
  • Function Execution: Real-time execution of AireGlu functions like UUID generation, date formatting, etc.
  • Data Transformations: Any mapping, filtering, or transformation logic you've configured

Using the Preview

  • Toggle Display: Use the "Display Preview" switch to show or hide the preview panel
  • Validation: Click the "Validate" button to check for errors and refresh the preview
  • Error Detection: Any issues with your mapping will be highlighted, requiring correction before the preview can display properly

In the example shown, the preview demonstrates:

  • The test property mapping from input data ($.name)
  • Live execution of the UUID function generating a real UUID value
  • The final JSON structure that will be output by this mapping task

task preview

Filters

Filters are used to look at available data, and determine if a task should run. It uses a JSONPath expression that returns true or false to decide where to run the task, or skip it. You can add multiple filters to your task or you can choose to copy the filters of one task to another.

filters