Skip to content

Commit c13b529

Browse files
committed
Add API for GetWorkflowExecutionResult
1 parent 8e0453c commit c13b529

4 files changed

Lines changed: 374 additions & 0 deletions

File tree

openapi/openapiv2.json

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4134,6 +4134,62 @@
41344134
]
41354135
}
41364136
},
4137+
"/api/v1/namespaces/{namespace}/workflows/{execution.workflowId}/result": {
4138+
"get": {
4139+
"summary": "GetWorkflowExecutionResult returns the result of a workflow execution. If the workflow\nis still running, returns a NotCompleted response and optionally registers callbacks\nto be invoked when the workflow completes.",
4140+
"operationId": "GetWorkflowExecutionResult2",
4141+
"responses": {
4142+
"200": {
4143+
"description": "A successful response.",
4144+
"schema": {
4145+
"$ref": "#/definitions/v1GetWorkflowExecutionResultResponse"
4146+
}
4147+
},
4148+
"default": {
4149+
"description": "An unexpected error response.",
4150+
"schema": {
4151+
"$ref": "#/definitions/rpcStatus"
4152+
}
4153+
}
4154+
},
4155+
"parameters": [
4156+
{
4157+
"name": "namespace",
4158+
"in": "path",
4159+
"required": true,
4160+
"type": "string"
4161+
},
4162+
{
4163+
"name": "execution.workflowId",
4164+
"in": "path",
4165+
"required": true,
4166+
"type": "string"
4167+
},
4168+
{
4169+
"name": "execution.runId",
4170+
"in": "query",
4171+
"required": false,
4172+
"type": "string"
4173+
},
4174+
{
4175+
"name": "requestId",
4176+
"description": "Used to de-dup requests (i.e., so we don't register the same callbacks multiple times).",
4177+
"in": "query",
4178+
"required": false,
4179+
"type": "string"
4180+
},
4181+
{
4182+
"name": "identity",
4183+
"in": "query",
4184+
"required": false,
4185+
"type": "string"
4186+
}
4187+
],
4188+
"tags": [
4189+
"WorkflowService"
4190+
]
4191+
}
4192+
},
41374193
"/api/v1/namespaces/{namespace}/workflows/{execution.workflowId}/trigger-rule": {
41384194
"post": {
41394195
"summary": "TriggerWorkflowRule allows to:\n * trigger existing rule for a specific workflow execution;\n * trigger rule for a specific workflow execution without creating a rule;\nThis is useful for one-off operations.",
@@ -9609,6 +9665,62 @@
96099665
]
96109666
}
96119667
},
9668+
"/namespaces/{namespace}/workflows/{execution.workflowId}/result": {
9669+
"get": {
9670+
"summary": "GetWorkflowExecutionResult returns the result of a workflow execution. If the workflow\nis still running, returns a NotCompleted response and optionally registers callbacks\nto be invoked when the workflow completes.",
9671+
"operationId": "GetWorkflowExecutionResult",
9672+
"responses": {
9673+
"200": {
9674+
"description": "A successful response.",
9675+
"schema": {
9676+
"$ref": "#/definitions/v1GetWorkflowExecutionResultResponse"
9677+
}
9678+
},
9679+
"default": {
9680+
"description": "An unexpected error response.",
9681+
"schema": {
9682+
"$ref": "#/definitions/rpcStatus"
9683+
}
9684+
}
9685+
},
9686+
"parameters": [
9687+
{
9688+
"name": "namespace",
9689+
"in": "path",
9690+
"required": true,
9691+
"type": "string"
9692+
},
9693+
{
9694+
"name": "execution.workflowId",
9695+
"in": "path",
9696+
"required": true,
9697+
"type": "string"
9698+
},
9699+
{
9700+
"name": "execution.runId",
9701+
"in": "query",
9702+
"required": false,
9703+
"type": "string"
9704+
},
9705+
{
9706+
"name": "requestId",
9707+
"description": "Used to de-dup requests (i.e., so we don't register the same callbacks multiple times).",
9708+
"in": "query",
9709+
"required": false,
9710+
"type": "string"
9711+
},
9712+
{
9713+
"name": "identity",
9714+
"in": "query",
9715+
"required": false,
9716+
"type": "string"
9717+
}
9718+
],
9719+
"tags": [
9720+
"WorkflowService"
9721+
]
9722+
}
9723+
},
96129724
"/namespaces/{namespace}/workflows/{execution.workflowId}/trigger-rule": {
96139725
"post": {
96149726
"summary": "TriggerWorkflowRule allows to:\n * trigger existing rule for a specific workflow execution;\n * trigger rule for a specific workflow execution without creating a rule;\nThis is useful for one-off operations.",
@@ -10706,6 +10818,36 @@
1070610818
},
1070710819
"description": "Target a worker polling on a Nexus task queue in a specific namespace."
1070810820
},
10821+
"GetWorkflowExecutionResultResponseCompleted": {
10822+
"type": "object",
10823+
"properties": {
10824+
"execution": {
10825+
"$ref": "#/definitions/v1WorkflowExecution"
10826+
},
10827+
"status": {
10828+
"$ref": "#/definitions/v1WorkflowExecutionStatus"
10829+
},
10830+
"result": {
10831+
"$ref": "#/definitions/v1Payloads",
10832+
"description": "Set only when status = COMPLETED."
10833+
},
10834+
"failure": {
10835+
"$ref": "#/definitions/v1Failure",
10836+
"description": "Set for FAILED / CANCELED / TERMINATED / TIMED_OUT."
10837+
}
10838+
}
10839+
},
10840+
"GetWorkflowExecutionResultResponseNotCompleted": {
10841+
"type": "object",
10842+
"properties": {
10843+
"execution": {
10844+
"$ref": "#/definitions/v1WorkflowExecution"
10845+
},
10846+
"status": {
10847+
"$ref": "#/definitions/v1WorkflowExecutionStatus"
10848+
}
10849+
}
10850+
},
1070910851
"LinkActivity": {
1071010852
"type": "object",
1071110853
"properties": {
@@ -15655,6 +15797,25 @@
1565515797
}
1565615798
}
1565715799
},
15800+
"v1GetWorkflowExecutionResultResponse": {
15801+
"type": "object",
15802+
"properties": {
15803+
"links": {
15804+
"type": "array",
15805+
"items": {
15806+
"type": "object",
15807+
"$ref": "#/definitions/v1Link"
15808+
},
15809+
"title": "Link to the relevant history event:\n- completion event, if the workflow has finished\n- options-updated event, if callbacks were registered on a running workflow"
15810+
},
15811+
"notCompleted": {
15812+
"$ref": "#/definitions/GetWorkflowExecutionResultResponseNotCompleted"
15813+
},
15814+
"completed": {
15815+
"$ref": "#/definitions/GetWorkflowExecutionResultResponseCompleted"
15816+
}
15817+
}
15818+
},
1565815819
"v1Header": {
1565915820
"type": "object",
1566015821
"properties": {

openapi/openapiv3.yaml

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3714,6 +3714,56 @@ paths:
37143714
application/json:
37153715
schema:
37163716
$ref: '#/components/schemas/Status'
3717+
/api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/result:
3718+
get:
3719+
tags:
3720+
- WorkflowService
3721+
description: |-
3722+
GetWorkflowExecutionResult returns the result of a workflow execution. If the workflow
3723+
is still running, returns a NotCompleted response and optionally registers callbacks
3724+
to be invoked when the workflow completes.
3725+
operationId: GetWorkflowExecutionResult
3726+
parameters:
3727+
- name: namespace
3728+
in: path
3729+
required: true
3730+
schema:
3731+
type: string
3732+
- name: execution.workflow_id
3733+
in: path
3734+
required: true
3735+
schema:
3736+
type: string
3737+
- name: execution.workflowId
3738+
in: query
3739+
schema:
3740+
type: string
3741+
- name: execution.runId
3742+
in: query
3743+
schema:
3744+
type: string
3745+
- name: requestId
3746+
in: query
3747+
description: Used to de-dup requests (i.e., so we don't register the same callbacks multiple times).
3748+
schema:
3749+
type: string
3750+
- name: identity
3751+
in: query
3752+
schema:
3753+
type: string
3754+
responses:
3755+
"200":
3756+
description: OK
3757+
content:
3758+
application/json:
3759+
schema:
3760+
$ref: '#/components/schemas/GetWorkflowExecutionResultResponse'
3761+
default:
3762+
description: Default error response
3763+
content:
3764+
application/json:
3765+
schema:
3766+
$ref: '#/components/schemas/Status'
37173767
/api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/trigger-rule:
37183768
post:
37193769
tags:
@@ -8659,6 +8709,56 @@ paths:
86598709
application/json:
86608710
schema:
86618711
$ref: '#/components/schemas/Status'
8712+
/namespaces/{namespace}/workflows/{execution.workflow_id}/result:
8713+
get:
8714+
tags:
8715+
- WorkflowService
8716+
description: |-
8717+
GetWorkflowExecutionResult returns the result of a workflow execution. If the workflow
8718+
is still running, returns a NotCompleted response and optionally registers callbacks
8719+
to be invoked when the workflow completes.
8720+
operationId: GetWorkflowExecutionResult
8721+
parameters:
8722+
- name: namespace
8723+
in: path
8724+
required: true
8725+
schema:
8726+
type: string
8727+
- name: execution.workflow_id
8728+
in: path
8729+
required: true
8730+
schema:
8731+
type: string
8732+
- name: execution.workflowId
8733+
in: query
8734+
schema:
8735+
type: string
8736+
- name: execution.runId
8737+
in: query
8738+
schema:
8739+
type: string
8740+
- name: requestId
8741+
in: query
8742+
description: Used to de-dup requests (i.e., so we don't register the same callbacks multiple times).
8743+
schema:
8744+
type: string
8745+
- name: identity
8746+
in: query
8747+
schema:
8748+
type: string
8749+
responses:
8750+
"200":
8751+
description: OK
8752+
content:
8753+
application/json:
8754+
schema:
8755+
$ref: '#/components/schemas/GetWorkflowExecutionResultResponse'
8756+
default:
8757+
description: Default error response
8758+
content:
8759+
application/json:
8760+
schema:
8761+
$ref: '#/components/schemas/Status'
86628762
/namespaces/{namespace}/workflows/{execution.workflow_id}/trigger-rule:
86638763
post:
86648764
tags:
@@ -12149,6 +12249,65 @@ components:
1214912249
type: string
1215012250
description: Will be set if there are more history events than were included in this response
1215112251
format: bytes
12252+
GetWorkflowExecutionResultResponse:
12253+
type: object
12254+
properties:
12255+
links:
12256+
type: array
12257+
items:
12258+
$ref: '#/components/schemas/Link'
12259+
description: |-
12260+
Link to the relevant history event:
12261+
- completion event, if the workflow has finished
12262+
- options-updated event, if callbacks were registered on a running workflow
12263+
notCompleted:
12264+
$ref: '#/components/schemas/GetWorkflowExecutionResultResponse_NotCompleted'
12265+
completed:
12266+
$ref: '#/components/schemas/GetWorkflowExecutionResultResponse_Completed'
12267+
GetWorkflowExecutionResultResponse_Completed:
12268+
type: object
12269+
properties:
12270+
execution:
12271+
$ref: '#/components/schemas/WorkflowExecution'
12272+
status:
12273+
enum:
12274+
- WORKFLOW_EXECUTION_STATUS_UNSPECIFIED
12275+
- WORKFLOW_EXECUTION_STATUS_RUNNING
12276+
- WORKFLOW_EXECUTION_STATUS_COMPLETED
12277+
- WORKFLOW_EXECUTION_STATUS_FAILED
12278+
- WORKFLOW_EXECUTION_STATUS_CANCELED
12279+
- WORKFLOW_EXECUTION_STATUS_TERMINATED
12280+
- WORKFLOW_EXECUTION_STATUS_CONTINUED_AS_NEW
12281+
- WORKFLOW_EXECUTION_STATUS_TIMED_OUT
12282+
- WORKFLOW_EXECUTION_STATUS_PAUSED
12283+
type: string
12284+
format: enum
12285+
result:
12286+
allOf:
12287+
- $ref: '#/components/schemas/Payloads'
12288+
description: Set only when status = COMPLETED.
12289+
failure:
12290+
allOf:
12291+
- $ref: '#/components/schemas/Failure'
12292+
description: Set for FAILED / CANCELED / TERMINATED / TIMED_OUT.
12293+
GetWorkflowExecutionResultResponse_NotCompleted:
12294+
type: object
12295+
properties:
12296+
execution:
12297+
$ref: '#/components/schemas/WorkflowExecution'
12298+
status:
12299+
enum:
12300+
- WORKFLOW_EXECUTION_STATUS_UNSPECIFIED
12301+
- WORKFLOW_EXECUTION_STATUS_RUNNING
12302+
- WORKFLOW_EXECUTION_STATUS_COMPLETED
12303+
- WORKFLOW_EXECUTION_STATUS_FAILED
12304+
- WORKFLOW_EXECUTION_STATUS_CANCELED
12305+
- WORKFLOW_EXECUTION_STATUS_TERMINATED
12306+
- WORKFLOW_EXECUTION_STATUS_CONTINUED_AS_NEW
12307+
- WORKFLOW_EXECUTION_STATUS_TIMED_OUT
12308+
- WORKFLOW_EXECUTION_STATUS_PAUSED
12309+
type: string
12310+
format: enum
1215212311
GoogleProtobufAny:
1215312312
type: object
1215412313
properties:

0 commit comments

Comments
 (0)