Workflow Transforms

Prev Next

Workflow transforms modify the structure or format of data during the creation or retrieval of a workflow submission. Use a workflow transform to ensure data compatibility when your workflow interacts with external systems or other Unqork processes.

Common examples for workflow transforms include:

  • Mapping to external schemas: Sending data to an integration that requires a specific format other than Unqork’s standard JSON.

  • Inbound data normalization: Converting data received from an external service into JSON so Unqork can process it.

  • Cross-workflow communication: Passing submissions between different Unqork workflows that use different Property IDs for the same data points.

How Workflow Transforms Work

A workflow transform defines the logic Unqork uses to reformat data. To configure a transform, you must define the direction, which determines whether the data is being prepared for Unqork or an external destination.

Transform Directions

The direction you choose dictates the available programming languages and output formats:

  • Input Transforms: Used for data entering Unqork. These transforms only use JSON because it’s the native data format for the Unqork platform.

  • Output Transforms: Used for data leaving Unqork. You must select a language compatible with your destination's requirements.

Supported Output Formats

When configuring an Output transform, refer to the following table for supported languages and their resulting formats:

Transform Language

Resulting Output Format

NJK

JSON

XSL

XML

NJK

PDF

NJK

XML

NJK

TXT

For Output transforms, verify the required schema and file type of your destination system before selecting an Output transform language.

Once a transform type is selected, you can write your transform and input any structural changes. For example, you might change the Label Text or Property ID when submitting between workflows.

Accessing the Workflow Transforms Modal

To access workflow transforms:

  1. Open your workflow in the Workflow Builder.

  2. Click the ··· (ellipsis) button.

  3. Select Transforms. The Transform modal displays.

    Menu options for editing, including settings and transforms for workflow management.

Understanding the Workflow Transforms Modal

The workflow Transforms modal lets Creators create, view, and modify transforms using a list of actions. If no active transforms exist, only the New Transforms button displays.

List of active transforms with details like type, direction, and modification dates.

If there are active transforms, the following table settings display:

Column

Description

Active Transforms  

The name of the transform.

Direction

The direction of the transform. Options include Input or Output.

Type

The type of transform, including the template language and the output format in parentheses:

  • NJK  (JSON): Where the template language is Nunjucks and the output format is in JSON.

  • XSL  (XML): Where the template language is XSL (eXtensible Stylesheet Language), and the output format is in XML.

  • NJK (PDF): Where the template language is Nunjucks and the output format is in PDF.

  • NJK (XML): Where the template language is Nunjucks and the output format is in XML.

  • NJK (TXT): Where the template language is Nunjucks and the output format is in TXT.

Created By  

The user who created the transform.

Last Modified

The date and time the transform was created.

Last Modified By

The user who last modified the transform.

Actions

The available actions you can take on the transform.

Actions include:

  • View and Edit: View transform details and make edits.

  • Download: Download the transform to your computer.

  • Delete: Permanently remove the transform.

Working with Transforms

Learn more about creating, referencing, testing, and manipulating transforms by clicking on the tabs below:

Creating a Transform

The first step of working with transforms in Unqork is to create one. To create a transform from the Transforms modal:

  1. Click + Add New Transform.

  2. In the Transform Name field, enter a name for your transform. Use this name to reference your transform in your module.

    Once created, you cannot change this name.

  3. Under Direction of Transform, select Input or Output depending on the direction of your transform.

  4. (Optional) For an Output type, click the Output tab and select the Type of Transform you want to use.

    By default, the only available Input type is NJK (JSON).

  5. In the Transform field, enter your transform.

    Overview of a transform process with input and output sections highlighted.                                            

  6. Click Save.

  7. Click Back to return to the Transforms modal. Or, click X to return to the Module Builder.

Referencing a Workflow Transform

Workflow Transforms function like transforms created in the Module Builder. The main difference is how you trigger a Workflow Builder transform. Module Builder transforms trigger a Plug-In component using the Execute Transform service, while workflows trigger their transform using the Get Workflow Submission service. The point in your workflow at which you add the Plug-In component depends on the use case.

Adding a Plug-In Component

Use a Plug-In component to make an API call to the Get Workflow Submission endpoint. Configure it to reference the name of your transform in the call.

The module where you configure the Plug-In component must exist in the workflow-type application where you created your transform.

  1. Open the module where you created the transform.

  2. In the Module Builder, drag and drop a Plug-In component onto the canvas.

  3. In the Property ID and Canvas Label Text fields, enter pluginExecuteTransform.

  4. From the Internal Services drop-down, enter or select Get Workflow Submission. The Data Source URL and Request Type fields populate.

  5. In the Data Source URL, replace the {workflowId} and {submissionId} placeholder values in with the workflow ID and workflow submission ID containing the transform.

    You have two options for replacing the placeholder values. You can manually input the workflow ID and submission ID values. Or, you can reference components in your module that are storing those values. If referencing a component in your module, retain the curly braces around the component's Property ID. If hardcoding the values, replace the {workflowId} and {submissionId} placeholders.

  6. In the Inputs table, enter the following:

    Property ID

    Mapping

    'Your Workflow ID'

    workflowId

    'Your Workflow Submission ID'

    submissionId

    'Your Transform Name'

    transformName

    Replace the Property ID fields with your workflow, submission, and transform values.

  7. In the Outputs table, enter the following:

    Property ID

    Mapping

    Option

    Header

    1

    data

    {{targetDestination}}

    Entering data references the entire object returned by the API call. Your transformed data returns as an object stored under the data key. You can also use dot notation to reference the fields stored inside the data object. To learn more about other parameters, view the Get Workflow Submission endpoint here: https://developers.unqork.io/#tag/Submissions%2Fpaths%2F~1workflows~1%7BworkflowId%7D~1submissions~1%7BsubmissionId%7D%2Fget.

    Consider the following resources for Transform Inputs and Outputs in the Plug-In component’s Outputs table:

    Transform Type

    Mapping

    Input

    Map the information coming out of the transform to the applicable field(s) in your module. This overrides the original information.

    Output

    Map the information coming from the transform to where you want it to go.

    Inputs and outputs for the plugin execution transformation are displayed in a table format.

  8. Click Save Component.

Adding a Button Component

Next, add a Button component to trigger the Plug-In component.

  1. Drag and drop a Button component onto your canvas, placing it below the pluginExecuteTransform Plug-In component.

  2. In the Property ID  field, enter btnExecuteTransform.

  3. In the Label Text field, enter Execute Transform.

  4. From the Action Type drop-down, select Event.

  5. From the On Click drop-down, enter or select pluginExecuteTransform.

  6. Click Save Compoenent.

  7. Save your module.

Testing a Transform

Test transforms by opening your workflow in Express View and creating a submission. Next, use the submission ID in the Transforms modal’s Unit Testing field.

To test your transform:

  1. Open your workflow in the Workflow Builder.

  2. Click the ellipsisButtonDummy.jpg (ellipsis) button.

  3. Select Transforms. Your transforms display in the Active Transforms table.

  4. From the Action drop-down, click View and Edit for the transform you want to test.

  5. Navigate to the bottom of the Transforms modal and expand the Unit Testing panel.

  6. In the Submission ID field, enter a submission ID. Submission data from the module populates in the Input field.

  7. Click Run Test. The transformed data displays in the Output field.

    A static image displaying how to test a transform.

Editing a Transform

After creating and testing your transform, you can make changes to it. Once you've created a transform, you can only change the Transform block or what your transform actually does.

To edit a transform:

  1. Open your module in the Module Builder.

  2. Click the ellipsisButtonDummy.jpg (ellipsis) button.

  3. Select Transforms. Your transforms display in the Active Transforms table.

  4. From the Action drop-down, click View and Edit for the transform you want to edit.

    Table displaying active transforms with options to view, edit, download, or delete.                                            

  5. Edit your transform as necessary.

    You cannot edit the transform name after creation.

  6. Click Save.

  7. Click Back to return to the Transforms modal. Or, click X to return to the Module Builder.

Downloading a Transform

If you restore a previously deleted module, the transform does not restore with it. To avoid having to recreate the transform, you can download it as a backup. Then, you can copy and paste it to a new transform.

It's important to note that your downloaded transform includes the transform body only. The file does not include the Unqork settings that go with it. To restore your Unqork settings, set them up as you would a new transform.

To download a transform:

  1. Open your module in the Module Builder.

  2. Click the ellipsisButtonDummy.jpg (ellipsis) button.

  3. Select Transforms. Your transforms display in the Active Transforms table.

  4. From the Action drop-down, click Download for the transform you want to download.

    Table displaying active transforms with options to download or delete entries.                                            

  5. Locate the file in the downloads folder of your computer.

Deleting a Transform

If you no longer need a transform, you can delete it.

Deleting a transform does not delete the components that reference it in a module.

To delete a transform:

  1. Open your module in the Module Builder.

  2. Click the ellipsisButtonDummy.jpg (ellipsis) button.

  3. Select Transforms. Your transforms display in the Active Transforms table.

  4. From the Action drop-down, click Delete for the transform you want to remove.

    Table displaying active transforms with options to view, edit, or delete entries.                                            

  5. At the Delete confirmation message, click OK.

Best Practices

Consider the following practices when using workflow transforms:

  • Build automated lane tasks to complete operations in five minutes to prevent timeouts. Input modules can complete operations as long as needed. The five-minute limitation does not apply to QA or Staging environments. However, workflows promoted to the Production environment are affected by the five-minute operation limit.

  • Create modules in the Automated Workflow lane with the following settings:

    • Enable Server-Side Execution Only in module settings for external API service endpoints that are configured in server administration. SSE prevents external services from seeing sensitive information such as financial data or PII.

    • Enable Customize RBAC for this Module in the module permissions.