Workflow Instances Query APIAPI Explorer

Introduction

API Introduction

The API is used to query workflow instances.

API Version

API Version

Updated Time

Description

V1

2023.09.18

1. Add a request parameter:

  • Type of returned task: tasks_type

2. Add some response parameters:

  • End time: finish_time
  • Task name: tasks[].title
  • Start time for tasks: tasks[].create_time
  • End time for tasks: tasks[].finish_time
  • Task status: tasks[].status

V2

2023.12.01

Add two response parameters:

  • The workflow action to create tasks: tasks[].create_action
  • The workflow action to complete tasks: tasks[].finish_action

API Calling

The API is used to query workflow instances.

Request URL: https://api.jodoo.com/api/v4/workflow/instance/get

Request Frequency: 30 times/second

Request Method: POST

Request Parameters:

Parameter

Required

Type

Description

instance_id

Yes

String

Instance ID is the same as data_id.

tasks_type

No

Number

Type of returned task. 0 refers to "Not return" and 1 "Return all".

Sample Request:

{
    "instance_id": "63ff32d918fbc20007a4a082",
    "tasks_type":1
}

Response Parameters:

Parameter

Type

Description

url

String

Instance access link

instance_id

String

Instance ID

app_id

String

App ID

form_id

String

Form ID

form_title

String

Form Name

update_time

String

Instance modification time

create_time

String

Created time

creator

Object

Creator information is the same as member entity structure.

status

number

Instance status:

  • 0 — In progress
  • 1 — Completed
  • 2 — End manually

tasks

Object[]

Task list

tasks[].app_id

String

App ID

tasks[].form_id

String

Form ID

tasks[].form_title

String

Form name

tasks[].title

String

Task name

tasks[].instance_id

String

Instance ID

tasks[].task_id

String

Task ID

tasks[].flow_id

number

Node ID

tasks[].flow_name

String

Node name

tasks[].url

String

Task access link

tasks[].assignee

Object[]

Pending task assignee information is the same as member entity structure.

tasks[].creator

Object

Instance creator information is the same as member entity structure.

tasks[].create_time

String

Start time for tasks

tasks[].create_action

String

Workflow-related actions for task creation:

  • auto_approve: remove duplicate approvers and keep the highest-level approver
  • forward: submit
  • back: return
  • transfer: hand over
  • revoke: withdraw
  • activate: activate
  • auto_forward: automatically submit overdue tasks
  • auto_back: automatically return overdue tasks
  • batch_forward: batch submit
  • batch_transfer: batch change approvers
  • sign_before: add a pre-approver
  • sign_after: add a post-approver
  • sign_parallel: add a parallel approver
  • invoke_plugin: run a plugin

tasks[].finish_time

String

End time for tasks

tasks[].finish_action

String

Workflow-related actions for task completion:

  • auto_approve: remove duplicate approvers and keep the highest-level approver
  • forward: submit
  • back: return
  • close: close
  • transfer: hand over
  • batch_forward: batch submit
  • sign_after: add a post-approver

tasks[].status

Number

Task status:

  • 0 — In progress
  • 1 — Completed
  • 2 — End manually
  • 4 — Activated
  • 5 — Paused

Sample Response:

{
    "app_id": "628d8c0d73544c0006a54bfd",
    "form_id": "63f31ae8144f4a09ec197163",
    "form_title": "Vehicle application",
    "instance_id": "63ff32d918fbc20007a4a082",
    "url": "https://www.jodoo.com/workflow/process_instance/63ff32d918fbc20007a4a082",
    "update_time": "2022-10-26T13:18:57.605Z",
    "create_time": "2022-10-26T13:11:45.087Z",
    "finish_time": null,
    "status": 0,
    "creator": {
        "username": "Jodoo Official",
        "name": "Jodoo",
        "departments": [
            1
        ],
        "type": 0,
        "status": 1
    },
    "tasks": [
        {
            "app_id": "628d8c0d73544c0006a54bfd",
            "form_id": "63f31ae8144f4a09ec197163",
            "form_title": "Vehicle application",
            "title": "Approval",
            "instance_id": "63ff32d918fbc20007a4a082",
            "task_id": "63f31ae8144f4a09ec197162",
            "flow_id": 0,
            "flow_name": "Aprroval",
            "url": "https://www.jiandaoyun.com/workflow/process_instance/63ff32d918fbc20007a4a082/task/63f31ae8144f4a09ec197162",
            "assignee": {
                "username": "Jodoo Official",
                "name": "Jodoo",
                "departments": [
                    1
                ],
                "type": 0,
                "status": 1
            },
            "creator": {
                "username": "Jodoo Official",
                "name": "Jodoo",
                "departments": [
                    1
                ],
                "type": 0,
                "status": 1
            },
            "create_time": "2022-10-26T13:11:45.087Z",
            "create_action": "forward",
            "finish_time": 2022-10-26T13:11:45.087Z,
            "finish_action": "forward",
            "status": 1
         },
        {
            "app_id": "628d8c0d73544c0006a54bfd",
            "form_id": "63f31ae8144f4a09ec197163",
            "form_title": "Vehicle application",
            "title": "Review",
            "instance_id": "63ff32d918fbc20007a4a082",
            "task_id": "63f31ae8144f4a09ec197163",
            "flow_id": 2,
            "flow_name": "Review",
            "url": "https://www.jiandaoyun.com/workflow/process_instance/63ff32d918fbc20007a4a082/task/63f31ae8144f4a09ec197163",
            "assignee": {
                "username": "Jodoo Official",
                "name": "Jodoo",
                "departments": [
                    1
                ],
                "type": 0,
                "status": 1
            },
            "creator": {
                "username": "Jodoo Official",
                "name": "Jodoo",
                "departments": [
                    1
                ],
                "type": 0,
                "status": 1
            },
            "create_time": "2022-10-26T13:18:57.605Z",
            "create_action": "forward",
            "finish_time": null,
            "finish_action": null,
            "status": 0
        }
    ]
}

Was this information helpful?
Yes
NoNo
Need more help? Contact support