You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _automating-configurations/api/create-workflow.md
+57-9Lines changed: 57 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -84,6 +84,24 @@ PUT /_plugins/_flow_framework/workflow/<workflow_id>?reprovision=true
84
84
You can add new steps to the workflow but cannot delete them. Only index setting, search pipeline, and ingest pipeline steps can currently be updated.
85
85
{: .note}
86
86
87
+
To control how long the request waits for the provisioning and reprovisioning process to complete, use the `wait_for_completion_timeout` parameter:
88
+
89
+
```json
90
+
POST /_plugins/_flow_framework/workflow/?provision=true&wait_for_completion_timeout=2s
91
+
```
92
+
{% include copy-curl.html %}
93
+
94
+
```json
95
+
PUT /_plugins/_flow_framework/workflow/<workflow_id>/?reprovision=true&wait_for_completion_timeout=2s
96
+
```
97
+
{% include copy-curl.html %}
98
+
99
+
If the operation does not complete within the specified amount of time, the response returns the current workflow status while execution continues asynchronously.
100
+
101
+
The `wait_for_completion_timeout` parameter can only be used when either `provision` or `reprovision` is set to `true`
102
+
{: .note}
103
+
104
+
For example, the following request provisions a workflow and waits for up to 2 seconds for completion:
87
105
You can create and provision a workflow using a [workflow template]({{site.url}}{{site.baseurl}}/automating-configurations/workflow-templates/) as follows:
88
106
89
107
```json
@@ -96,14 +114,15 @@ POST /_plugins/_flow_framework/workflow?use_case=<use_case>&provision=true
96
114
97
115
The following table lists the available query parameters. All query parameters are optional. User-provided parameters are only allowed if the `provision` parameter is set to `true`.
98
116
99
-
| Parameter | Data type | Description |
100
-
| :--- | :--- | :--- |
101
-
|`provision`| Boolean | Whether to provision the workflow as part of the request. Default is `false`. |
102
-
|`update_fields`| Boolean | Whether to update only the fields included in the request body. Default is `false`. |
103
-
|`reprovision`| Boolean | Whether to reprovision the entire template if it has already been provisioned. A complete template must be provided in the request body. Default is `false`. |
104
-
|`validation`| String | Whether to validate the workflow. Valid values are `all` (validate the template) and `none` (do not validate the template). Default is `all`. |
105
-
|`use_case`| String | The name of the [workflow template]({{site.url}}{{site.baseurl}}/automating-configurations/workflow-templates/#supported-workflow-templates) to use when creating the workflow. |
106
-
| User-provided substitution expressions | String | Parameters matching substitution expressions in the template. Only allowed if `provision` is set to `true`. Optional. If `provision` is set to `false`, you can pass these parameters in the [Provision Workflow API query parameters]({{site.url}}{{site.baseurl}}/automating-configurations/api/provision-workflow/#query-parameters). |
|`provision`| Boolean | Whether to provision the workflow as part of the request. Default is `false`. |
120
+
|`update_fields`| Boolean | Whether to update only the fields included in the request body. Default is `false`. |
121
+
|`reprovision`| Boolean | Whether to reprovision the entire template if it has already been provisioned. A complete template must be provided in the request body. Default is `false`. |
122
+
|`validation`| String | Whether to validate the workflow. Valid values are `all` (validate the template) and `none` (do not validate the template). Default is `all`. |
123
+
|`use_case`| String | The name of the [workflow template]({{site.url}}{{site.baseurl}}/automating-configurations/workflow-templates/#supported-workflow-templates) to use when creating the workflow. |
124
+
|`wait_for_completion_timeout`| Time value | Specifies the maximum wait time for synchronous provisioning or reprovisioning. If the timeout is exceeded, the request returns the current workflow status while execution continues asynchronously.|
125
+
| User-provided substitution expressions | String | Parameters matching substitution expressions in the template. Only allowed if `provision` is set to `true`. Optional. If `provision` is set to `false`, you can pass these parameters in the [Provision Workflow API query parameters]({{site.url}}{{site.baseurl}}/automating-configurations/api/provision-workflow/#query-parameters). |
107
126
108
127
## Request body fields
109
128
@@ -291,4 +310,33 @@ OpenSearch responds with the `workflow_id`:
291
310
}
292
311
```
293
312
294
-
Once you have created a workflow, you can use other workflow APIs with the `workflow_id`.
313
+
Once you have created a workflow, you can use other workflow APIs with the `workflow_id`.
314
+
315
+
#### Example response with wait_for_completion_timeout enabled
Copy file name to clipboardExpand all lines: _automating-configurations/api/provision-workflow.md
+38-1Lines changed: 38 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ POST /_plugins/_flow_framework/workflow/<workflow_id>/_provision?<parameter>=<va
39
39
| Parameter | Data type | Description |
40
40
| :--- | :--- | :--- |
41
41
| User-provided substitution expressions | String | Parameters matching substitution expressions in the template. Optional. |
42
+
|`wait_for_completion_timeout`| TimeValue | Specifies the maximum wait time for synchronous provisioning. If the timeout is exceeded, the request returns the current workflow status while execution continues asynchronously.|
42
43
43
44
#### Example requests
44
45
@@ -47,6 +48,13 @@ POST /_plugins/_flow_framework/workflow/8xL8bowB8y25Tqfenm50/_provision
47
48
```
48
49
{% include copy-curl.html %}
49
50
51
+
The following request performs a synchronous provisioning call, waiting for up to 2 seconds for completion:
52
+
53
+
```json
54
+
POST /_plugins/_flow_framework/workflow/<workflow_id>/_provision&wait_for_completion_timeout=2s
55
+
```
56
+
{% include copy-curl.html %}
57
+
50
58
The following request substitutes the expression {% raw %}`${{ openai_key }}`{% endraw %} with the value "12345" using a query parameter:
51
59
52
60
```json
@@ -74,4 +82,33 @@ OpenSearch responds with the same `workflow_id` that was used in the request:
74
82
}
75
83
```
76
84
77
-
To obtain the provisioning status, query the [Get Workflow State API]({{site.url}}{{site.baseurl}}/automating-configurations/api/get-workflow-status/).
85
+
To obtain the provisioning status, call the [Get Workflow State API]({{site.url}}{{site.baseurl}}/automating-configurations/api/get-workflow-status/).
86
+
87
+
#### Example response with wait_for_completion_timeout enabled
0 commit comments