Run the workflow on a Transactionlink-hosted page

Learn how to run a workflow on a standalone Transactionlink-hosted page with minimal frontend effort.

You’ll build a simple integration where the user clicks a button in your app and gets redirected to a hosted workflow page.

The example includes both client- and server-side code, and shows how to create a workflow execution and redirect the user to the prebuilt, secure interface hosted by Transactionlink. The workflow is displayed on a standalone page hosted by Transactionlink. You trigger the execution from your backend, then redirect the user to the url.

This setup is ideal when you want to get started quickly without building your own UI.

Use this approach when:

  • You want to integrate fast, with minimal frontend work

  • You're sending workflow links via email, SMS, or other channels

  • You don’t need to embed the flow inside your app

  • You want to offload UI hosting and focus on backend logic


1

Set up the server

Create a Workflow Execution

Add an endpoint on your server that creates a Workflow Execution. The response includes a link, which points to a standalone, secure page hosted by TransactionLink. Redirect the user to this link so they can complete the workflow in a separate tab or view.

We recommend creating a new execution each time a user starts a workflow, to ensure that the flow is fresh and state is isolated for every attempt.

const express = require('express');
const axios = require('axios');
const { v4: uuidv4 } = require('uuid');

app.post('/create-workflow', async (req, res) => {

  const executionPayload = {
    recordId: uuidv4(),
    workflowDefinitionId: uuidv4(),
    expiresAt: new Date(Date.now() + 60 * 60 * 1000).toISOString(),
    locale: 'en',
  };

  const execution = await axios.post(
    'https://api.transactionlink.io/workflows',
    executionPayload,
    {
      headers: {
        Authorization: `Bearer ${ACCESS_TOKEN}`,
        'Content-Type': 'application/json',
      },
    }
  );

   res.send({
    link: execution.data.link,
    executionId: execution.data.id,
  });
  
});

app.listen(8080, () => console.log('Running on port 8080'));

Set the workflow to execute

workflowDefinitionIdUUID (required) The ID of the workflow you want to execute. This refers to a predefined flow configured in your TransactionLink Dashboard.

📌 You can find the workflowDefinitionId in the Dashboard by viewing the workflow’s details.


Set an expiration time

expiresAtISO 8601 timestamp

Defines when the workflow execution becomes invalid.

  • Must be between 30 minutes and 24 hours from creation.

  • If omitted, defaults to 1 hour.

🔐 Use this to enforce time-limited actions (e.g. document upload, identity verification) and avoid stale sessions.


Set the interface language

localeIETF language tag (e.g. en, pl, de)

Controls the language of the user-facing interface.

  • If set to auto or left blank, we detect the user’s browser language.

  • Use this to enforce a specific language for localized flows.

2

Build your page

Obtain a redirection URL

Use an API created on your server in previous step to receive a link for your workflow execution. You can trigger an HTTP call for the token when your application needs to launch the widget - on a button click, page load, or in any other scenario that is specific to your use case.

async function getLink() {
    try {
        const response = await fetch('/create-workflow', { method: 'POST' });
        const data = await response.json()
        return data.link;
    } catch (err) {
        console.error(err);
        throw err;
    }
}

Redirect to widget

Use the link and redirect the user. The flow will then continue in a widget hosted on our end.

<script>
async function redirectToWidget() {
    window.location = await getLink();
}

document.getElementById('open-widget')
    .addEventListener('click', redirectToWidget);
</script>

<!-- Button to trigger the widget -->
<button id="open-widget">Open Hosted Widget</button>
3

Get notified about workflow status

There are two ways to notify your backend when something happens in the workflow

1. Webhook Task

You can add a Webhook Task directly in your workflow. This lets you send a custom HTTP POST request to your server at any point during the flow — with a payload you fully control.

Use it when:

  • You want to notify your backend during a specific step in the process

  • You need to trigger external logic or update another system

  • You want to send dynamic data collected earlier in the flow

  • You want to notify your server when the process is completed — with your own payload

Tip: Place a Webhook Task at the end of the workflow to send a custom completion signal, including any relevant context or identifiers.

Both options can be used together or independently — depending on your use case.

2. Polling the API (Long polling)

As an alternative, you can implement long polling from your backend. This involves periodically calling the TransactionLink API to check the status of a specific workflow execution.

While not real-time, long polling can be useful when:

  • You cannot expose a public webhook endpoint

  • Your infrastructure requires strict control over incoming connections

  • You need fallback logic when webhooks are unavailable or blocked

4

Congratulations!

You’ve successfully set up a basic TransactionLink integration.

Now, learn how to customize your workflow experience — from styling the hosted page to configuring dynamic logic and automating data collection using workflow tasks and parameters.

Last updated

Was this helpful?