# ProcessInstances

## GET /api/v1/instances/{agentGroupId}

> List Process Instances

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"ProcessInstanceFilter":{"enum":["ShowAll","ShowRunning","ShowFinished","ShowSuccessful","ShowFailed","ShowFailedNotAcknowledged"],"type":"string"},"DtoProcessInstanceGet":{"required":["Data"],"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProcessInstanceViewModel"},"description":"Response data"},"nextContinuationToken":{"type":"string","description":"ContinuationToken to be used in the next query <b>Warning! If any filters except continuationToken are changed between requests the results will be invalid</b>\r\n            <br>If the token is null there are no more results to fetch with the selected filters</br>","nullable":true},"nextLink":{"$ref":"#/components/schemas/LinkModel"}},"additionalProperties":false},"ProcessInstanceViewModel":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"parentId":{"type":"integer","format":"int64","nullable":true},"processId":{"type":"integer","format":"int32"},"rootProcessId":{"type":"integer","format":"int32","nullable":true},"processVersion":{"type":"integer","format":"int32"},"state":{"$ref":"#/components/schemas/ExecutionState"},"startTimeUtc":{"type":"string","format":"date-time","nullable":true},"endTimeUtc":{"type":"string","format":"date-time","nullable":true},"utcDate":{"type":"string","format":"date-time"},"utcHour":{"type":"integer","format":"int32"},"executionId":{"type":"string","format":"uuid"},"triggerId":{"type":"integer","format":"int32","nullable":true},"agentId":{"type":"integer","format":"int32"},"environmentId":{"type":"integer","format":"int32"},"agentGroupId":{"type":"integer","format":"int32"},"exception":{"type":"string","nullable":true},"userName":{"type":"string","nullable":true},"stepsLoggedToBlobs":{"type":"boolean","nullable":true},"hasLoggedSteps":{"type":"boolean","nullable":true},"acknowledgedUtc":{"type":"string","format":"date-time","nullable":true},"commentJson":{"type":"string","nullable":true},"comment":{"type":"string"},"promotedData":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/ProcessPromotedData"},"nullable":true},"triggerName":{"type":"string","nullable":true},"environmentName":{"type":"string","nullable":true},"agentName":{"type":"string","nullable":true},"processGuid":{"type":"string","format":"uuid"},"parentName":{"type":"string","nullable":true},"triggerRequest":{"$ref":"#/components/schemas/JToken"},"triggerResponses":{"$ref":"#/components/schemas/JToken"},"promotedColumns":{"type":"array","items":{"$ref":"#/components/schemas/PromotedColumn"},"nullable":true}},"additionalProperties":false},"ExecutionState":{"enum":["Ok","Waiting","Launched","Starting","Started","Canceled","CanceledByTerminate","FinishedAsZombie","TerminatedByUser","ActionSkipped","Failed","Exception","Finished"],"type":"string"},"ProcessPromotedData":{"required":["environmentName","promotedValueJson","promotedVariableName"],"type":"object","properties":{"id":{"type":"integer","format":"int64"},"processExecutionId":{"type":"string","format":"uuid"},"timeStamp":{"type":"string","format":"date-time"},"environmentName":{"type":"string"},"promotedVariableName":{"type":"string"},"promotedValueJson":{"type":"string"}},"additionalProperties":false},"JToken":{"type":"array","items":{"$ref":"#/components/schemas/JToken"}},"PromotedColumn":{"type":"object","properties":{"name":{"type":"string","nullable":true},"value":{"$ref":"#/components/schemas/JToken"}},"additionalProperties":false},"LinkModel":{"type":"object","properties":{"uri":{"type":"string","format":"uri"},"method":{"type":"string"}},"additionalProperties":false}}},"paths":{"/api/v1/instances/{agentGroupId}":{"get":{"tags":["ProcessInstances"],"summary":"List Process Instances","operationId":"ListInstances","parameters":[{"name":"agentGroupId","in":"path","description":"Agent Group where Process Instances should be fetched from","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"processGuids","in":"query","description":"Filter by Processes","schema":{"type":"array","items":{"type":"string","format":"uuid"}}},{"name":"startTime","in":"query","description":"Filter by Execution start time","schema":{"type":"string","format":"date-time"}},{"name":"endTime","in":"query","description":"Filter by Execution end time","schema":{"type":"string","format":"date-time"}},{"name":"stateFilter","in":"query","description":"Filter by Execution state","schema":{"$ref":"#/components/schemas/ProcessInstanceFilter"}},{"name":"isChildProcess","in":"query","description":"Filter by whether process is a child process (i.e. a subprocess, if not started manually)","schema":{"type":"boolean"}},{"name":"continuationToken","in":"query","description":"If there are more results to be shown a continuationToken will be needed to show the next set of results. This token is passed as nextContinuationToken in the result of the previous query. <b>Warning! If any filters except continuationToken are changed between requests the results will be invalid</b>","schema":{"type":"string"}},{"name":"pageSize","in":"query","description":"Maximum page size is 200. Default page size is 50","schema":{"type":"integer","format":"int32","default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DtoProcessInstanceGet"}}}},"404":{"description":"Agent group not found","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## GET /api/v1/instances/{agentGroupId}/{executionIdentifier}/details

> Get Process Instance Details

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"ProcessInstanceExecutionDetailsViewModelResponse":{"required":["Data"],"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProcessInstanceExecutionDetailsViewModel"}},"additionalProperties":false},"ProcessInstanceExecutionDetailsViewModel":{"type":"object","properties":{"id":{"type":"integer","format":"int64","readOnly":true},"parentId":{"type":"integer","format":"int64","nullable":true},"parentName":{"type":"string"},"executionId":{"type":"string","format":"uuid","readOnly":true},"processGuid":{"type":"string","format":"uuid"},"rootProcessGuid":{"type":"string","format":"uuid","nullable":true},"processVersion":{"type":"integer","format":"int32","readOnly":true},"state":{"$ref":"#/components/schemas/ExecutionState"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/ProcessInstanceStepReferenceViewModel"},"readOnly":true},"stepDataUri":{"type":"string","nullable":true},"startTimeUtc":{"type":"string","format":"date-time","nullable":true,"readOnly":true},"endTimeUtc":{"type":"string","format":"date-time","nullable":true,"readOnly":true},"duration":{"type":"string","format":"date-span","nullable":true,"readOnly":true},"environment":{"type":"string"},"agentGroup":{"type":"string"},"agent":{"type":"string"},"exception":{"type":"string","nullable":true,"readOnly":true},"userName":{"type":"string"},"triggerName":{"type":"string"},"processParameters":{"$ref":"#/components/schemas/JToken"},"processReturnValues":{"$ref":"#/components/schemas/JToken"},"hasLoggedSteps":{"type":"boolean","nullable":true}},"additionalProperties":false},"ExecutionState":{"enum":["Ok","Waiting","Launched","Starting","Started","Canceled","CanceledByTerminate","FinishedAsZombie","TerminatedByUser","ActionSkipped","Failed","Exception","Finished"],"type":"string"},"ProcessInstanceStepReferenceViewModel":{"required":["loopParameters","stepId"],"type":"object","properties":{"id":{"type":"integer","format":"int64"},"state":{"$ref":"#/components/schemas/ExecutionState"},"stepId":{"type":"string"},"loopParameters":{"$ref":"#/components/schemas/JToken"}},"additionalProperties":false},"JToken":{"type":"array","items":{"$ref":"#/components/schemas/JToken"}}}},"paths":{"/api/v1/instances/{agentGroupId}/{executionIdentifier}/details":{"get":{"tags":["ProcessInstances"],"summary":"Get Process Instance Details","parameters":[{"name":"agentGroupId","in":"path","description":"Agent Group where Process Instance should be fetched from","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"executionIdentifier","in":"path","description":"Execution identifier of the Process Instance","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessInstanceExecutionDetailsViewModelResponse"}}}},"404":{"description":"Process Instance not found","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```

## GET /api/v1/instances/counts/{agentGroupId}

> Returns Process instance counts

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"ProcessCountsByAgentGroupAndProcessAndDateTimeResponse":{"required":["Data"],"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProcessCountsByAgentGroupAndProcessAndDateTime"}},"additionalProperties":false},"ProcessCountsByAgentGroupAndProcessAndDateTime":{"required":["executionCounts"],"type":"object","properties":{"executionCounts":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ProcessInstanceExecutionCounts"}}}}},"additionalProperties":false},"ProcessInstanceExecutionCounts":{"type":"object","properties":{"running":{"type":"integer","format":"int32","nullable":true},"latestRunning":{"type":"string","format":"date-time","nullable":true},"successful":{"type":"integer","format":"int32","nullable":true},"latestSuccessful":{"type":"string","format":"date-time","nullable":true},"failed":{"type":"integer","format":"int32","nullable":true},"latestFailed":{"type":"string","format":"date-time","nullable":true},"erroredNotAcknowledged":{"type":"integer","format":"int32","nullable":true},"latestExecutionState":{"$ref":"#/components/schemas/ExecutionState"}},"additionalProperties":false},"ExecutionState":{"enum":["Ok","Waiting","Launched","Starting","Started","Canceled","CanceledByTerminate","FinishedAsZombie","TerminatedByUser","ActionSkipped","Failed","Exception","Finished"],"type":"string"},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/instances/counts/{agentGroupId}":{"get":{"tags":["ProcessInstances"],"summary":"Returns Process instance counts","parameters":[{"name":"agentGroupId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"ProcessUniqueIdentifiers","in":"query","description":"The unique identifiers of the Processes to get the counts for.","schema":{"type":"array","items":{"type":"string","format":"uuid"},"description":"The unique identifiers of the Processes to get the counts for."}},{"name":"StartTime","in":"query","description":"The start time of the execution of the Processes to get the counts for.","schema":{"type":"string","description":"The start time of the execution of the Processes to get the counts for.","format":"date-time"}},{"name":"EndTime","in":"query","description":"The end time of the execution of the Processes to get the counts for.","schema":{"type":"string","description":"The end time of the execution of the Processes to get the counts for.","format":"date-time"}},{"name":"GroupedHourly","in":"query","description":"Groups counts by hour instead of by date.","schema":{"type":"boolean","description":"Groups counts by hour instead of by date."}},{"name":"CountsTimeLimitDays","in":"query","description":"Limit counts by days","schema":{"type":"integer","description":"Limit counts by days","format":"int32"}}],"responses":{"200":{"description":"The filtered Process instance counts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessCountsByAgentGroupAndProcessAndDateTimeResponse"}}}},"404":{"description":"Agent group not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## POST /api/v1/instances/{agentGroupId}/{processGuid}/acknowledge

> Acknowledges errors of specified instances of the specified Process in the specified Agent Group.

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"AcknowledgeInstanceErrorsQueryModel":{"required":["instanceIds","reason"],"type":"object","properties":{"reason":{"type":"string"},"instanceIds":{"type":"array","items":{"type":"integer","format":"int64"}}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/instances/{agentGroupId}/{processGuid}/acknowledge":{"post":{"tags":["ProcessInstances"],"summary":"Acknowledges errors of specified instances of the specified Process in the specified Agent Group.","parameters":[{"name":"agentGroupId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"processGuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcknowledgeInstanceErrorsQueryModel"}}}},"responses":{"204":{"description":"Operation was successful."},"400":{"description":"No Agent Group ID provided.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Could not find Agent Group with the specified ID.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## POST /api/v1/instances/{agentGroupId}/{processGuid}/comment

> Comments specified Process instances in the Agent Group.

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"CommentInstancesQueryModel":{"required":["comment","instanceIds"],"type":"object","properties":{"comment":{"type":"string"},"processGuids":{"type":"array","items":{"type":"string","format":"uuid"},"nullable":true},"instanceIds":{"type":"array","items":{"type":"integer","format":"int64"}}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/instances/{agentGroupId}/{processGuid}/comment":{"post":{"tags":["ProcessInstances"],"summary":"Comments specified Process instances in the Agent Group.","parameters":[{"name":"agentGroupId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"processGuid","in":"path","description":"GUID of the Process.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentInstancesQueryModel"}}}},"responses":{"200":{"description":"Operation was successful."},"400":{"description":"No Agent Group name provided.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Could not find Agent Group with the specified ID.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## GET /api/v1/instances/{agentGroupId}/{processGuid}/export

> Downloads CSV-exported data of Process instances of a specified Process in a specified Agent Group, from a specified timespan.

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/instances/{agentGroupId}/{processGuid}/export":{"get":{"tags":["ProcessInstances"],"summary":"Downloads CSV-exported data of Process instances of a specified Process in a specified Agent Group, from a specified timespan.","parameters":[{"name":"agentGroupId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"processGuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"startTime","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"endTime","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"instanceIds","in":"query","description":"IDs of the Process instances. If unspecified, the operation will return 10000 instances.","schema":{"type":"array","items":{"type":"integer","format":"int64"}}}],"responses":{"200":{"description":"CSV file download.","content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"No Agent Group name provided.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Could not find Agent Group with the specified ID.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## POST /api/v1/instances/{agentGroupId}/{processGuid}/delete

> Deletes Process instances of a specified Process in a specified Agent Group.

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/instances/{agentGroupId}/{processGuid}/delete":{"post":{"tags":["ProcessInstances"],"summary":"Deletes Process instances of a specified Process in a specified Agent Group.","parameters":[{"name":"agentGroupId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"processGuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"Array of Process instance identifiers.","content":{"application/json":{"schema":{"type":"array","items":{"type":"integer","format":"int64"}}}},"required":true},"responses":{"200":{"description":"Operation was successful."},"400":{"description":"No Agent Group name provided.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Could not find Agent Group with the specified ID.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```


---

# 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.frends.com/reference/frends-6.1.0/frends-platform-api/platform-api-reference/processinstances.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.
