Skip to content

Commit

Permalink
Merge pull request #17259 from amosher-github/patch-2
Browse files Browse the repository at this point in the history
Update nerdgraph-api-workflows.mdx
  • Loading branch information
nbaenam committed May 10, 2024
2 parents d2569b9 + bba45c2 commit 29c528e
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,18 @@ mutation {

## Update a workflow [#update-workflow]

When you update a workflow, note the only mandatory attributes you need to supply are the workflow ID and account ID. The rest are optional. For example, you only need to supply the name if you only intend to update the name.
When you update a workflow, note the only mandatory attributes you need to supply are the `accountId` under `aiWorkflowsUpdateWorkflow` and the `id` of the workflow under `updateWorkflowData`. The rest are optional. For example, you only need to supply the name if you only intend to update the name.

To get the workflow ID, go to the workflow table and click <DoNotTranslate>**...**</DoNotTranslate> at the end of the row. Then, choose <DoNotTranslate>**Copy workflow id to clipboard**</DoNotTranslate>.
To get the workflow ID, go to the workflow table and click the <DoNotTranslate>**<Icon name="fe-more-horizontal"/>**</DoNotTranslate> icon at the end of the row. Then, choose <DoNotTranslate>**Copy workflow id to clipboard**</DoNotTranslate>.

Here's an example of updating a workflow:
Here's an example of updating a workflow's name and two channels:

```graphql
mutation {
aiWorkflowsUpdateWorkflow(accountId: YOUR_ACCOUNT_ID, updateWorkflowData: {name: "UPDATED_API_DEMO_WORKFLOW", id: WORKFLOW_ID}) {
aiWorkflowsUpdateWorkflow(
accountId: YOUR_ACCOUNT_ID
updateWorkflowData: { name: "UPDATED_WORKFLOW_NAME", id: WORKFLOW_ID, destinationConfigurations:[{channelId: "12345abc-6de7-8f90-g123-4h56i78j9klm", notificationTriggers: [ACTIVATED]}, {channelId: "zy0987xw-v65u-432t-10s9-r876qpo543n2", notificationTriggers: [ACTIVATED]}]}
) {
workflow {
id
name
Expand Down Expand Up @@ -362,4 +365,3 @@ mutation {
}
}
```

0 comments on commit 29c528e

Please sign in to comment.