---
updatedAt: 2026-10-19T13:54:43.000Z
agentTools:
  projectIndex: https://developers.youtrust.com/llms.txt
---

# How to guide - Create & Execute your first Workflow Session

A step-by-step guide to create and execute your first Workflow Session.

In this example, let’s say you need to onboard a new customer: Kelly Smith.

Before becoming a customer, Kelly must complete your onboarding workflow:

1. Verify her identity
2. Sign a contract

In this workflow, your **Workflow Template** contains 2 Action Groups:

* Identity Verification
* Signature Request

<Callout icon="➡️" theme="default">
  ### Before you start:

  Make sure your organization already has a Workflow Template.

  * Not sure? Call the [`GET /workflow_templates`](https://developers.youtrust.com/reference/get-workflow_templates) endpoint.
  * If no Workflow Template exists, [contact our team](https://youtrust.com/workflows)—we’ll create one tailored to your needs.
</Callout>

# Step 1: Retrieve the Workflow Template ID

Endpoint: [List Workflow Templates](https://developers.youtrust.com/reference/get-workflow_templates) (`GET /workflow_templates`)

```json Request
// no request body required
```
```json Response example
{
  "meta": {
    "next_cursor": null
  },
  "data": [
    {
      "id": "35a07993...",
      "name": "Customer onboarding",
      "action_groups": [
        {
          "type": "identity_verification"
        },
        {
          "type": "signature_request"
        }
      ],
      "workspaces": [],
      "created_at": "2025-09-10T12:56:59+00:00",
      "updated_at": "2025-09-10T12:56:59+00:00"
    }
  ]
}
```

👉 Save the Id value—you’ll need it to create a Workflow Session.

# Step 2: Create a new Workflow Session

* Endpoint: [Create a new Workflow Session](https://developers.youtrust.com/reference/post-workflow_sessions) (`POST /workflow_sessions`)
* Content type: `application/json`

In the request, pass the Workflow Template Id.

Give the session a clear name so it’s easy to identify later in the app dashboard.

```json Request
{
  "name": "Onboarding of Kelly Smith",
  "workflow_template_id": "35a07993...",
  "workspace_id": null
}
```
```json Response example
{
  "id": "c0cbf043...",
  "name": "Onboarding of Kelly Smith",
  "workflow_template_id": "35a07993...",
  "workspace_id": "814aac47...",
  "status": "awaiting",
  "action_groups": [
    {
      "type": "identity_verification",
      "status": "awaiting",
      "actions": []
    },
    {
      "type": "signature_request",
      "status": "awaiting",
      "actions": []
    }
  ],
  "created_at": "2025-09-22T14:30:00+00:00",
  "updated_at": "2025-09-22T14:30:00+00:00"
}
```

At this point, all Action Groups are empty and the Workflow Session status is `awaiting`.

# Step 3: Verify Kelly Smith’s Identity

* Endpoint: [Initiate a new Identity Document Verification](https://developers.youtrust.com/reference/post-verifications-identity_documents) (`POST /verifications/identity_documents`)
* Content type: *multipart/form-data*

Include the Workflow Session Id in your request.

```curl Request
--form 'file=@"/path/to/the/document/my_document.pdf"' \
--form 'workflow_session_id="c0cbf043..."'
```
```json Response example
{
  "id": "79a291fc...",
  "workspace_id": "814aac47...",
  "created_at": "2025-09-22T14:32:00+00:00",
  "updated_at": "2025-09-22T14:32:00+00:00",
  "status": "verified",
  "status_codes": [],
  "data_anonymized": false,
  "data": {
    "extracted_from_document": {
      "first_name": "Kelly",
      "birth_name": "Smith",
      "last_name": "Smith",
      "born_on": "1990-07-13",
      "birth_location": "Paris",
      "gender": "m",
      "full_address": "18 rue de Londres\nParis\nFRANCE",
      "type": "id_card",
      "issuing_country_code": "FR",
      "issued_on": "2020-08-11",
      "expired_on": "2030-08-10",
      "document_number": "X4RBBPBW4",
      "mrz": {
        "line1": "IDFRAX4RTBPFW46<<<<<<<<<<<<<<<",
        "line2": "9007138F3002119FRA<<<<<<<<<<<6",
        "line3": "SMITH<<KELLY<<<<<<<<<<<<<<<<<<<<<"
      }
    }
  }
}
```

The identity verification succeeded, so the resource status is now `verified`.

# Step 4: Check the Workflow Session status

Endpoint: [Retrieve a Workflow Session](https://developers.youtrust.com/reference/get-workflow_sessions-id) (`GET /workflow_sessions/{workflowSessionId}`)

```json Request
// no request body required
```
```json Response example
{
  "id": "c0cbf043...",
  "name": "Onboarding of Kelly Smith",
  "workflow_template_id": "35a07993...",
  "workspace_id": "814aac47...",
  "status": "ongoing",
  "action_groups": [
    {
      "type": "identity_verification",
      "status": "done",
      "actions": [
        {
          "resource": {
            "id": "79a291fc...",
            "type": "identity_document_verification",
            "status": "verified"
          }
        }
      ]
    },
    {
      "type": "signature_request",
      "status": "awaiting",
      "actions": []
    }
  ],
  "created_at": "2025-09-22T14:30:00+00:00",
  "updated_at": "2025-09-22T14:32:30+00:00"
}
```

The Action Group of type Identity Verification is now `done`, so the Workflow Session status has moved to `ongoing`.

# Step 5: Create and send the contract for signature to Kelly Smith

* Endpoint: [Initiate a new Signature Request](https://developers.youtrust.com/reference/post-signature_requests-1) (`POST /signature_requests`)
* Content type: `application/json`

```json Request
{
  "name": "Kelly Smith contract",
  "delivery_mode": "email",
  "workflow_session_id": "c0cbf043..."
}
```
```json Response example
{
  "id": "6f7001fc...",
  "source": "public_api",
  "status": "draft",
  "name": "Kelly Smith contract",
  "created_at": "2025-09-22T14:34:00+00:00",
  "email_custom_note": null,
  "ordered_signers": false,
  "timezone": "Europe/Paris",
  "reminder_settings": null,
  "expiration_date": "2026-03-22T14:34:00+00:00",
  "delivery_mode": "email",
  "documents": [],
  "signers": [],
  "external_id": null,
  "branding_id": null,
  "custom_experience_id": null,
  "sender": null,
  "workspace_id": "814aac47...",
  "audit_trail_locale": "en",
  "signers_allowed_to_decline": false,
  "bulk_send_batch_id": null,
  "email_notification": {
    "sender": {
      "type": "organization",
      "custom_name": null
    },
    "custom_note": null
  }
}
```

Next steps:

1. Add a **Document**, **Signer**, and **Signature Field** to the Signature Request\*\*.\*\*
2. Activate the Signature Request.

<Callout icon="📖" theme="default">
  ### For detailed instructions, see _How to guide - Create your first Signature Request_.
</Callout>

Once Kelly signs the contract, the Signature Request status becomes `done`.

# Step 6: Retrieve the final Workflow Session status

Endpoint: [Retrieve a Workflow Session](https://developers.youtrust.com/reference/get-workflow_sessions-id) (`GET /workflow_sessions/{workflowSessionId}`)

```json Request
// no request body required
```
```json Response example
{
  "id": "c0cbf043...",
  "name": "Onboarding of Kelly Smith",
  "workflow_template_id": "35a07993...",
  "workspace_id": "814aac47...",
  "status": "done",
  "action_groups": [
    {
      "type": "identity_verification",
      "status": "done",
      "actions": [
        {
          "resource": {
            "id": "79a291fc...",
            "type": "identity_document_verification",
            "status": "verified"
          }
        }
      ]
    },
    {
      "type": "signature_request",
      "status": "awaiting",
      "actions": [
        {
          "resource": {
            "id": "6f7001fc...",
            "type": "signature_request",
            "status": "done"
          }
        }
      ]
    }
  ],
  "created_at": "2025-09-22T14:30:00+00:00",
  "updated_at": "2025-09-22T14:40:00+00:00"
}
```

All statuses are now `done`—Kelly Smith has successfully completed the onboarding workflow 🎉

<Callout icon="💡" theme="default">
  ### Build this with your AI tool

  Connect the [Developer MCP](https://developers.youtrust.com/docs/mcp) and run each step from your AI editor, in `sandbox` first.
</Callout>