# Process Runtime API

The **Process Runtime API** provides a set of RESTful endpoints that allow external systems to interact with **process flows** managed by the ONEWEB Process Engine.

These APIs support standard operations required to **start processes**, **manage tasks**, **assign work**, and **control runtime behavior** of process instances.

This section documents all available Process Runtime API methods and explains their functionality.\
All endpoints are accessed relative to the application **context root** and are subject to the same authentication and authorization rules defined for ONEWEB APIs.

***

### API Capabilities

Using the Process Runtime API, clients can:

* Start a new process flow
* Claim and complete tasks
* Retrieve tasks by instance, user, role, or group
* Assign tasks or entire process instances to users
* Read runtime task variables
* Refresh process runtime cache

***

### Start Process

#### `POST /BPMREST/service/runtime/process/start`

Starts a new process flow.

* **Description**\
  Initiates a new process instance using the configured process definition.
* **HTTP Method**\
  `POST`

***

#### Legacy Start Process (Not Recommended)

#### `POST /BPMREST/service/runtime/process/{processName}/start`

* **Description**\
  Legacy API used to start a process flow by process name.\
  This endpoint is **not recommended** and should be avoided in new integrations.
* **HTTP Method**\
  `POST`

***

### Task Management APIs

#### Claim Task

#### `POST /BPMREST/service/runtime/tasks/{taskId}/claim?user={username}`

* **Description**\
  Claims a task for a specific user.
* **HTTP Method**\
  `POST`

***

#### Complete Task

#### `POST /BPMREST/service/runtime/tasks/{taskId}/complete?user={username}`

* **Description**\
  Completes a task assigned to the specified user, advancing the process flow.
* **HTTP Method**\
  `POST`

***

#### Get Tasks by Process Instance

#### `GET /BPMREST/service/runtime/instance/{instanceId}/tasks`

* **Description**\
  Retrieves all tasks associated with a specific process instance ID.
* **HTTP Method**\
  `GET`

***

#### Get Tasks by User, Role, or Group

#### `GET /BPMREST/service/runtime/tasks?{group|role|user}={name}`

* **Description**\
  Retrieves tasks assigned to a specific **user**, **role**, or **group**.
* **HTTP Method**\
  `GET`

***

### Task Data APIs

#### Get Task Variables

#### `POST /BPMREST/service/runtime/tasks/{taskId}/variables`

* **Description**\
  Retrieves all runtime variables associated with the specified task.
* **HTTP Method**\
  `POST`

***

### Assignment APIs

#### Assign Task to Users

#### `POST /BPMREST/service/runtime/tasks/{taskId}/assign?user={user1}&user={user2}&...`

* **Description**\
  Assigns a task to one or more users.
* **HTTP Method**\
  `POST`

***

#### Assign Process Instance to User

#### `POST /BPMREST/service/runtime/instance/{instanceId}/tasks/assign?user={username}`

* **Description**\
  Assigns all tasks within a process instance to a specific user.
* **HTTP Method**\
  `POST`

***

### Runtime Maintenance APIs

#### Refresh Process Cache (All Processes)

#### `POST /BPMREST/service/runtime/refreshCache`

* **Description**\
  Refreshes runtime cache for all process definitions.
* **HTTP Method**\
  `POST`

***

#### Refresh Process Cache (Specific Process)

#### `POST /BPMREST/service/runtime/classAction`

* **Description**\
  Refreshes runtime cache for a specific process.
* **HTTP Method**\
  `POST`

***

### Summary

The **Process Runtime API** enables full lifecycle interaction with process flows in ONEWEB.

Key characteristics:

* REST‑based interface for process management
* Supports both process‑level and task‑level operations
* Enables user‑centric task handling and assignment
* Allows runtime introspection through variables
* Provides cache management for process definitions

This API is essential for **workflow automation**, **task orchestration**, and **integration with external systems**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onewebstack.com/api-reference/process-runtime-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
