Skip to main content
Home
  • AI Mode
  • Supply Chain Orchestration
    fast
    Supply Chain Orchestration
    • Life Sciences Company
    • Direct Material Supplier
    • Contract Manufacturer
    • Third Party Logistics
    • Wholesale Distributor
    • Healthcare Provider
    • Retail Pharmacy
  • Network
  • Products
    fast
    Products
    • Multienterprise Information Network Tower (MINT)
    • Process Orchestration for Empowered Teams (POET)
    • Track-and-Trace
  • Resources
    fast
    Resources
    • Resource Center
    • TraceLink University
    • TraceLink Glossary
    • Partners
    • Community
    • Events
    • Customers
  • About
    fast
    About
    • Our Story
    • Newsroom
    • Culture and Careers
    • Leadership
    • Our Values
    • Corporate Social Responsibility
    • Contact Sales
  • Log In
    • Tracelink Classic
      TraceLink Classic app.tracelink.com
      Redirect
    • Opus Platform
      Opus Platform opus.tracelink.com
      Redirect
Log In
  • Tracelink Classic
    TraceLink Classic app.tracelink.com
    Redirect
  • Opus Platform
    Opus Platform opus.tracelink.com
    Redirect
Tracelink University

Breadcrumb

  1. Home
  2. Resources
  3. TraceLink University

Workflow Customization Guide

  • Download PDF
  • Share
    • LinkedIn
    • Facebook
    • Mail
    • Twitter

Table of contents

Overview

This guide explains how to customize workflows and subworkflows in the TraceLink platform. It is designed for customers who want to implement specific business logic using transition conditions and actions. This guide covers:

  • Understanding workflows and subworkflows
  • Adding subworkflows
  • Defining transition conditions
  • Executing transition actions
  • Real-world examples for both conditions and actions

Workflows and Subworkflows

Workflows define the lifecycle of an object (e.g., a request, task, or document) in the TraceLink platform, outlining the states an object can move through and the transitions that govern those changes.

They consist of:

  • Base States - An object can be in one of several predefined base states, such as Draft, In Review, or Approved. Base states are set by the application developer and cannot be customized by customers.
  • Transitions - Transitions define how an object moves from one state to another. Each transition can include logic, such as event handlers that run when the transition occurs.

Subworkflows are specialized workflows that exist within the context of a parent workflow. They allow for additional customization and can include their states and transitions. Subworkflows enable customers to tailor workflows to their specific business processes without altering the base workflow defined by the application developer.

For example, a base workflow might include a state called "Pending Approval," while a subworkflow could define specific approval steps, such as "Pending Approval by Product Architect" or "Pending Approval by CTO." This modular approach allows for flexibility and reusability of workflow logic.

Adding a Subworkflow to a Parent Workflow

To embed a subworkflow within a parent workflow in the TraceLink platform, follow the steps below using the OSE (Object Solution Editor) interface. This allows you to modularize your workflow logic and tailor it to your business needs.

  1. Navigate to the Workflow section - Go to the OSE Solutions tab in the TraceLink platform and select Workflow from the left-hand navigation panel.
  2. Select the Target Solution - Choose the solution in which you want to add the subworkflow. This will open the details related to that solution’s workflow.

    details related to that solution’s workflow
  3. Access the Workflow Details page - Once the solution is selected, you will be directed to the Workflow Details page.
  4. Enter Edit Mode - Select Edit button to enable workflow customization options.

    enable workflow customization options
  5. Choose the Parent Workflow - From the list of available workflows, select the parent workflow where you want to embed the subworkflow.
  6. Add a Subworkflow - Click the “+” (plus) icon next to the workflow state where the subworkflow should be inserted. This opens the subworkflow configuration panel.

    subworkflow configuration panel
  7. Configure and Apply - Enter the required fields (e.g., subworkflow name, associated base state, etc.), then select Apply to embed the subworkflow into the parent workflow.

    embed the subworkflow into the parent workflow

    Enter the fields to create a Subworkflow.

    Fields to create Subworkflow

Transition Conditions

Transition conditions are logical rules that determine whether a transition between two states in a workflow is allowed to occur. These conditions are evaluated at runtime, and the transition only proceeds if the condition evaluates to true.
They allow you to enforce business logic dynamically based on:

  • Field values in the object
  • User roles or permissions
  • Related object data
  • External system responses

Transition conditions help ensure that:

  • Only the right users can trigger certain transitions
  • Transitions happen only when the data is complete or valid
  • Workflow logic adapts to the current state of the object or system
Transition conditions

Pre-transition conditions must be written as a single line of code. Multi-line conditions are not supported and will result in execution failure.

Transition Actions

Transition actions are tasks or operations that are automatically executed when a transition between workflow states occurs. These actions are triggered after the transition condition (if any) evaluates to true and the transition is allowed to proceed.

They are used to automate business logic, trigger side effects, or update the system when an object changes state.
Transition actions help you:

  • Enforce business processes automatically
  • Keep related systems or objects in sync
  • Send notifications or alerts
  • Create or update related data
  • Integrate with external APIs
Transition actions

Post-transition Actions must be written as a single line of code. Multi-line conditions are not supported and will result in execution failure.

Transition Condition Use Cases and Scripts (examples)

Restrict Transition Based on Last Updated User

The Pre-Transition condition prevents a transition if the user attempting the transition is the same user who last updated the object.

function evaluateCondition(dnpContext, commonConditionObject) {
  let isConditionSuccessful = true;
  if (
    JSON.parse(commonConditionObject.data.payloadRef).lastUpdatedByUserId ==
    JSON.stringify(dnpContext.headers().event().userId())
  ) {
    dnpContext.log().info("Not good for transition");
    isConditionSuccessful = false;
  }
  return isConditionSuccessful;
}

Enforce Transitions Based on User Permissions

The Pre-Transition condition ensures that only users with a specific permission are allowed to perform the transition.

function evaluateCondition(dnpContext, commonConditionObject) {
  let isTransitionSuccessful = 'true';
  const payload = JSON.parse(commonConditionObject.data.payloadRef);
  if (!role.permissions().includes("PERMISSION_NAME")) {
    isTransitionSuccessful = 'false';
  }
  return isTransitionSuccessful;
}

Transaction Action Use Cases and Scripts (examples)

Querying a Related Object During Transition

This action retrieves data from another object using GraphQL (GQL), enabling dynamic decision-making during the transition.

const related = gql.queryObject("PurchaseOrder", { id: object.poId });

Creating a New Object Automatically

The Post-Transition action initiates the creation of a new object, such as a child item or task, when a workflow transition is executed.

async function triggerTransition(dnpContext, commonTransitionObject) {
  return await dnpContext.transport().events().send(
    "agile-process-teams:item-new:v2",
    "agile-process-teams",
    {
      item: {
        objectAction: "new",
        payload: {
          id: "",
          schemaId: "agile-process-teams:item",
          schemaVersion: 1,
          objectType: "agile-process-teams:item",
          subType: "",
          data: {
            itemTitle: "devtesting1"
          }
        }
      }
    }
  );

Integrating with External Systems via API Call

The Post-Transition action sends a POST request to an external system (e.g., a Slack webhook or third-party API) as part of the transition logic.

function triggerTransition(dnpContext, commonTransitionObject) {
  const host = "hooks.slack.com";
  const path = "PATH";
  const datatosend = { text: "TEXT" };
  dnpContext
    .transport()
    .https()
    .post(host, path, datatosend)
    .then(function (resp) {
      console.log("Received response: " + resp.statusCode);
      return {
        statusCode: resp.statusCode,
        reasonPhrase: resp.reasonPhrase,
        headers: JSON.stringify(resp.headers),
        contentLength: resp.entity.contentLength,
        contentType: resp.entity.contentType,
        rawContent: resp.entity.rawContent
      };
    })
    .catch(function (err) {
      console.log("Got error: " + err.name + " : " + err.message);
      throw err;
    });
  return payload;
}

Update Fields in the Current Object

You can update fields only in the object undergoing the state transition. Updating a different object is not supported, as its ID is not accessible within the transition context.

Sample Workflow Transition Payload Structure

The following is a sample object structure passed as a parameter to pre-transition conditions and post-transition actions within a TraceLink workflow. This payload provides contextual information about the object undergoing the state transition, including metadata, workflow states, user information, and business data.

This structure is typically accessed in the workflow customization scripts via commonConditionObject or commonTransitionObject, and is essential for writing dynamic logic in custom conditions and actions.

{
    "id": "a798b28a-7df9-4965-bec9-7cf713fb7001",
    "data": {
        "fromState": {
            "baseState": "ToDo"
        },
        "toState": {
            "baseState": "InProgress",
            "subState": "Approved"
        },
        "objectType": "agile-process-teams:ext_TRACELINK_triageWorkItem",
        "payloadRef": {
            "schemaVersion": 3,
            "currentBaseState": "InProgress",
            "data": {
                "workItemTitle": "t",
                "dueDate": 1751155200000,
                "followers": [
                    {
                        "followerId": "e89f5ba0-f4f6-4932-9640-dd9dc9b40d84"
                    },
                    {
                        "followerId": "c02dfe02-b872-40a2-ac50-75b5ffe3bc93"
                    }
                ],
                "fkProcessNetworkId": "31859341-3038-45c2-95aa-0f68d752ea65",
                "initiatingCompany": {
                    "address1": "74 Main St",
                    "address2": "Street GALESBURG",
                    "postalCode": "49053",
                    "city": "Washington",
                    "state": "MI",
                    "country": "US",
                    "businessPhone": "978-222-1112",
                    "fax": "9062479",
                    "identifiersTypeValue": "DUNS 123456789,GCP 979367924,GLN 9793679248323,SGLN 979367924.832.0",
                    "identifiersTypeValueWithBusinessName": "QAOwnerCorp202411201416407991 DUNS 123456789,QAOwnerCorp202411201416407991 GCP 979367924,QAOwnerCorp202411201416407991 GLN 9793679248323,QAOwnerCorp202411201416407991 SGLN 979367924.832.0",
                    "primaryIdentifierType": "GLN",
                    "primaryIdentifierValue": "9793679248323",
                    "businessName": "QAOwnerCorp202411201416407991"
                },
                "createdByUser": {
                    "userEmail": "qeauto+qaownercorp202411201416407991-coa [at] tracelink.com",
                    "userName": "Megan Griffin"
                },
                "creationTimestamp": 1750758849118,
                "lastModifiedByUser": {
                    "userEmail": "qeauto+qaownercorp202411201416407991-int [at] tracelink.com",
                    "userName": "Janet Miller"
                },
                "lastModifiedTimestamp": 1750842896108,
                "displayIdentifier": "WI-12",
                "currentState": "ToDo"
            },
            "schemaId": "agile-process-teams:workItem",
            "subType": "ext_TRACELINK_triageWorkItem",
            "id": "a798b28a-7df9-4965-bec9-7cf713fb7001",
            "objectType": "agile-process-teams:workItem",
            "ownerId": "bd4d1af0-b2f1-41ec-8807-ef5d364feecc",
            "dataVersion": 3,
            "lastUpdatedDateTime": 1750842896309,
            "lastUpdatedByUserId": "c02dfe02-b872-40a2-ac50-75b5ffe3bc93",
            "contextualOwnerId": "bd4d1af0-b2f1-41ec-8807-ef5d364feecc",
            "createdByUserId": "e89f5ba0-f4f6-4932-9640-dd9dc9b40d84",
            "creationDateTime": 1750758849471,
            "dataSource": "dataCache",
            "isFresh": true,
            "currentSubState": "Approved"
        }
    }
}
TraceLink University

Table of contents

Related Content
Page Types
Understanding Page Types within the OPUS Solution Environment (OSE)
Page types enable Solution Designers to efficiently create user-friendly pages using a drag-and-drop interface, allowing them to organize information for optimal usability.
View More
Anthem Design Guide
UX Writing and Terminology
The goal is to create UI text that is clear and concise, offering users the essential information they need to effectively complete their tasks.
View More
Opus Ensemble UX
Introducing OPUS Ensemble
TraceLink's OPUS Ensemble, the first next-generation solution on the OPUS Platform, revolutionizes user interaction by seamlessly integrating personalized settings, powerful navigation, and company-specific context for efficient access to notifications, support, and essential tools.
View More
Opus Ensemble
OPUS Ensemble Patterns
Enabling OPUS Solution Designers to understand Ensemble patterns, which includes user context, settings, and browser-style navigation for streamlined access.
View More
Sample
Define and Design Search Pages
Search pages enable users to view, search for, and create new object instances, typically serving as the landing page when navigating to a solution, except when only one instance exists (like the Profile page in Settings), in which case the user is directed to the View/Edit page.
View More
Workflows
Define and Design Workflows
This guidance outlines essential practices for designing effective workflows that enhance efficiency and flexibility in business processes, focusing on primary objects to help OPUS Solution Designers create impactful solutions.
View More

Cookie Settings

When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies or similar tracking technologies. Please see below for an overview of the categories of cookies and similar technologies used on this site. You can allow or deny some of all of them, except Strictly Necessary Cookies which are required to provide the site to you. However, blocking some types of cookies may impact your experience of the site and services we are able to offer.

Please see our Cookie Policy for more details, including a list of the cookies we use. You can change your consent options at any time by following the “Cookie Settings” link in the Cookie Policy.
'Strictly Necessary' cookies let you move around the Site and use essential features like secure areas, shopping baskets and online billing. Without these cookies you would not be able to navigate between pages or use certain vital features of our Site, so we do not require your consent for their use. These cookies don't gather any information about you that could be used for marketing or remembering where you've been on the internet. For example, we use these Strictly Necessary cookies to identify you as being logged in to the Site. You can set your browser to block or alert you about these cookies, but if you do so, some parts of the Site will not work.
'Performance' cookies collect information about how you use the Site, such as which pages you visit, the time spent on the Site and if you experience any errors. We use performance cookies to provide aggregated statistics on how the Site is used and help us improve the Site including by measuring any errors that occur.
'Functional' cookies are used to provide services or to remember settings to improve your visit. We use 'Functionality' cookies to remember your settings and choices and show you when you're logged in to the Site.
‘Targeting' cookies are linked to services provided by third parties, such as 'Like' buttons and 'Share' buttons. The third party provides these services in return for recognizing that you have visited the Site. We also use 'Targeting' cookies to gather information that could be used to display content that we think may interest you.

Footer

  • Quick Links
    Get a Demo
    TraceLink Network Directory
    The Network
    OPUS Platform
    Technical Support
    Open Jobs
    API: Terms of Use
  • Products
    Multienterprise Information Network Tower
    U.S. DSCSA Compliance
    Targeted Recalls
    Process Orchestration for Empowered Teams
    Serialization
    Global Compliance
  • Resources
    Resource Center
    Events
    TraceLink University
    Partners
    Community
  • About TraceLink
    Our Story
    Newsroom
    Culture & Careers
    Leadership
    Our Values
    Corporate Social Responsibility
  • Hot Topics
    Transaction Integration
    Supply Chain Visibility
    DSCSA Compliance
    Process Orchestration
    Kazakhstan Compliance for Pharmaceuticals
    Kyrgyzstan Compliance for Pharmaceuticals
Follow Us on Social
Facebook
Linkedin
X
Legal & Trust.
© TraceLink Inc. 2009-2026 All Rights Reserved
Contact Us Today
Contact us today to begin your journey toward agentic supply chain orchestration — digitalize your end-to-end supply chain with intelligence, flexibility, and collaborative orchestration.
Contact Us
Stay Up-to-Date
Subscribe to receive industry insights and stay at the forefront of evolving trends.
Subscribe