Skip to main content
PUT
/
v2
/
workflows
/
{id}
UpdateWorkflow
curl --request PUT \
  --url https://api.incident.io/v2/workflows/{id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "annotations": {
    "incident.io/terraform/version": "3.0.0"
  },
  "condition_groups": [
    {
      "conditions": [
        {
          "operation": "one_of",
          "param_bindings": [
            {
              "array_value": [
                {
                  "literal": "SEV123",
                  "reference": "incident.severity"
                }
              ],
              "value": {
                "literal": "SEV123",
                "reference": "incident.severity"
              }
            }
          ],
          "subject": "incident.severity"
        }
      ]
    }
  ],
  "continue_on_step_error": true,
  "delay": {
    "conditions_apply_over_delay": false,
    "for_seconds": 60
  },
  "expressions": [
    {
      "else_branch": {
        "result": {
          "array_value": [
            {
              "literal": "SEV123",
              "reference": "incident.severity"
            }
          ],
          "value": {
            "literal": "SEV123",
            "reference": "incident.severity"
          }
        }
      },
      "label": "Team Slack channel",
      "operations": [
        {
          "branches": {
            "branches": [
              {
                "condition_groups": [
                  {
                    "conditions": [
                      {
                        "operation": "one_of",
                        "param_bindings": [
                          {
                            "array_value": [
                              {
                                "literal": "SEV123",
                                "reference": "incident.severity"
                              }
                            ],
                            "value": {
                              "literal": "SEV123",
                              "reference": "incident.severity"
                            }
                          }
                        ],
                        "subject": "incident.severity"
                      }
                    ]
                  }
                ],
                "result": {
                  "array_value": [
                    {
                      "literal": "SEV123",
                      "reference": "incident.severity"
                    }
                  ],
                  "value": {
                    "literal": "SEV123",
                    "reference": "incident.severity"
                  }
                }
              }
            ],
            "returns": {
              "array": true,
              "type": "IncidentStatus"
            }
          },
          "concatenate": {
            "reference": "catalog_attribute[\"01FCNDV6P870EA6S7TK1DSYD5H\"]"
          },
          "filter": {
            "condition_groups": [
              {
                "conditions": [
                  {
                    "operation": "one_of",
                    "param_bindings": [
                      {
                        "array_value": [
                          {
                            "literal": "SEV123",
                            "reference": "incident.severity"
                          }
                        ],
                        "value": {
                          "literal": "SEV123",
                          "reference": "incident.severity"
                        }
                      }
                    ],
                    "subject": "incident.severity"
                  }
                ]
              }
            ]
          },
          "navigate": {
            "reference": "catalog_attribute[\"01FCNDV6P870EA6S7TK1DSYD5H\"]"
          },
          "operation_type": "navigate",
          "parse": {
            "returns": {
              "array": true,
              "type": "IncidentStatus"
            },
            "source": "metadata.annotations[\"github.com/repo\"]"
          }
        }
      ],
      "reference": "abc123",
      "root_reference": "incident.status"
    }
  ],
  "folder": "My folder 01",
  "include_private_escalations": true,
  "include_private_incidents": true,
  "name": "My little workflow",
  "once_for": [
    "incident.url"
  ],
  "runs_on_incident_modes": [
    "standard",
    "test",
    "retrospective"
  ],
  "runs_on_incidents": "newly_created",
  "shortform": "page-the-ceo",
  "skip_step_upgrades": false,
  "state": "active",
  "steps": [
    {
      "for_each": "abc123",
      "id": "abc123",
      "name": "pagerduty.escalate",
      "param_bindings": [
        {
          "array_value": [
            {
              "literal": "SEV123",
              "reference": "incident.severity"
            }
          ],
          "value": {
            "literal": "SEV123",
            "reference": "incident.severity"
          }
        }
      ]
    }
  ]
}
'
{
  "management_meta": {
    "annotations": {
      "incident.io/terraform/version": "3.0.0"
    },
    "managed_by": "dashboard",
    "source_url": "https://github.com/my-company/infrastructure"
  },
  "workflow": {
    "condition_groups": [
      {
        "conditions": [
          {
            "operation": {
              "label": "Lawrence Jones",
              "value": "01FCQSP07Z74QMMYPDDGQB9FTG"
            },
            "param_bindings": [
              {
                "array_value": [
                  {
                    "label": "Lawrence Jones",
                    "literal": "SEV123",
                    "reference": "incident.severity"
                  }
                ],
                "value": {
                  "label": "Lawrence Jones",
                  "literal": "SEV123",
                  "reference": "incident.severity"
                }
              }
            ],
            "subject": {
              "label": "Incident Severity",
              "reference": "incident.severity"
            }
          }
        ]
      }
    ],
    "continue_on_step_error": true,
    "delay": {
      "conditions_apply_over_delay": false,
      "for_seconds": 60
    },
    "expressions": [
      {
        "else_branch": {
          "result": {
            "array_value": [
              {
                "label": "Lawrence Jones",
                "literal": "SEV123",
                "reference": "incident.severity"
              }
            ],
            "value": {
              "label": "Lawrence Jones",
              "literal": "SEV123",
              "reference": "incident.severity"
            }
          }
        },
        "label": "Team Slack channel",
        "operations": [
          {
            "branches": {
              "branches": [
                {
                  "condition_groups": [
                    {
                      "conditions": [
                        {
                          "operation": {
                            "label": "Lawrence Jones",
                            "value": "01FCQSP07Z74QMMYPDDGQB9FTG"
                          },
                          "param_bindings": [
                            {
                              "array_value": [
                                {
                                  "label": "Lawrence Jones",
                                  "literal": "SEV123",
                                  "reference": "incident.severity"
                                }
                              ],
                              "value": {
                                "label": "Lawrence Jones",
                                "literal": "SEV123",
                                "reference": "incident.severity"
                              }
                            }
                          ],
                          "subject": {
                            "label": "Incident Severity",
                            "reference": "incident.severity"
                          }
                        }
                      ]
                    }
                  ],
                  "result": {
                    "array_value": [
                      {
                        "label": "Lawrence Jones",
                        "literal": "SEV123",
                        "reference": "incident.severity"
                      }
                    ],
                    "value": {
                      "label": "Lawrence Jones",
                      "literal": "SEV123",
                      "reference": "incident.severity"
                    }
                  }
                }
              ],
              "returns": {
                "array": true,
                "type": "IncidentStatus"
              }
            },
            "filter": {
              "condition_groups": [
                {
                  "conditions": [
                    {
                      "operation": {
                        "label": "Lawrence Jones",
                        "value": "01FCQSP07Z74QMMYPDDGQB9FTG"
                      },
                      "param_bindings": [
                        {
                          "array_value": [
                            {
                              "label": "Lawrence Jones",
                              "literal": "SEV123",
                              "reference": "incident.severity"
                            }
                          ],
                          "value": {
                            "label": "Lawrence Jones",
                            "literal": "SEV123",
                            "reference": "incident.severity"
                          }
                        }
                      ],
                      "subject": {
                        "label": "Incident Severity",
                        "reference": "incident.severity"
                      }
                    }
                  ]
                }
              ]
            },
            "navigate": {
              "reference": "1235",
              "reference_label": "Teams"
            },
            "operation_type": "navigate",
            "parse": {
              "returns": {
                "array": true,
                "type": "IncidentStatus"
              },
              "source": "metadata.annotations[\"github.com/repo\"]"
            },
            "returns": {
              "array": true,
              "type": "IncidentStatus"
            }
          }
        ],
        "reference": "abc123",
        "returns": {
          "array": true,
          "type": "IncidentStatus"
        },
        "root_reference": "incident.status"
      }
    ],
    "folder": "My folder 01",
    "id": "01FCNDV6P870EA6S7TK1DSYDG0",
    "include_private_escalations": true,
    "include_private_incidents": true,
    "name": "My little workflow",
    "once_for": [
      {
        "array": false,
        "key": "incident.custom_field[\"01FCNDV6P870EA6S7TK1DSYDG0\"]",
        "label": "Incident -> Affected Team",
        "type": "IncidentSeverity"
      }
    ],
    "runs_from": "2021-08-17T13:28:57.801578Z",
    "runs_on_incident_modes": [
      "standard",
      "test",
      "retrospective"
    ],
    "runs_on_incidents": "newly_created",
    "shortform": "page-the-ceo",
    "state": "active",
    "steps": [
      {
        "for_each": "abc123",
        "id": "abc123",
        "label": "PagerDuty Escalate",
        "name": "pagerduty.escalate",
        "param_bindings": [
          {
            "array_value": [
              {
                "label": "Lawrence Jones",
                "literal": "SEV123",
                "reference": "incident.severity"
              }
            ],
            "value": {
              "label": "Lawrence Jones",
              "literal": "SEV123",
              "reference": "incident.severity"
            }
          }
        ]
      }
    ],
    "trigger": {
      "label": "Incident Updated",
      "name": "incident.updated"
    },
    "version": 3
  }
}

Path Parameters

id
string
required

ID of the workflow to update

Example:

"01FCNDV6P870EA6S7TK1DSYDG0"

Body

application/json
condition_groups
object[]
required

Conditions that apply to the workflow trigger

Example:
[
{
"conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
]
}
]
continue_on_step_error
boolean
required

Whether to continue executing the workflow if a step fails

Example:

true

expressions
object[]
required

The expressions to use in the workflow

Example:
[
{
"else_branch": {
"result": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"label": "Team Slack channel",
"operations": [
{
"branches": {
"branches": [
{
"condition_groups": [
{
"conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
]
}
],
"result": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
],
"returns": { "array": true, "type": "IncidentStatus" }
},
"concatenate": {
"reference": "catalog_attribute[\"01FCNDV6P870EA6S7TK1DSYD5H\"]"
},
"filter": {
"condition_groups": [
{
"conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
]
}
]
},
"navigate": {
"reference": "catalog_attribute[\"01FCNDV6P870EA6S7TK1DSYD5H\"]"
},
"operation_type": "navigate",
"parse": {
"returns": { "array": true, "type": "IncidentStatus" },
"source": "metadata.annotations[\"github.com/repo\"]"
}
}
],
"reference": "abc123",
"root_reference": "incident.status"
}
]
include_private_incidents
boolean
required

Whether to include private incidents

Example:

true

name
string
required

Name provided by the user when creating the workflow

Example:

"My little workflow"

once_for
string[]
required

This workflow will run 'once for' a list of references

Example:
["incident.url"]
runs_on_incident_modes
enum<string>[]
required

Which incident modes should this workflow run on? By default, workflows only run on standard incidents, but can also be configured to run on test and retrospective incidents.

Available options:
standard,
test,
retrospective
Example:
["standard", "test", "retrospective"]
runs_on_incidents
enum<string>
required

Which incidents should the workflow be applied to?

Available options:
newly_created,
newly_created_and_active
Example:

"newly_created"

steps
object[]
required

Steps that are executed as part of the workflow

Example:
[
{
"for_each": "abc123",
"id": "abc123",
"name": "pagerduty.escalate",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
]
}
]
annotations
object

Annotations that track metadata about this resource

Example:
{ "incident.io/terraform/version": "3.0.0" }
delay
object
Example:
{
"conditions_apply_over_delay": false,
"for_seconds": 60
}
folder
string

Folder to display the workflow in

Example:

"My folder 01"

include_private_escalations
boolean

Whether to include private escalations

Example:

true

shortform
string

The shortform used to trigger this workflow (only applicable for manual triggers)

Example:

"page-the-ceo"

skip_step_upgrades
boolean

Skips workflow step upgrades, when the parameters for an existing workflow step change

Example:

false

state
enum<string>

What state this workflow is in

Available options:
active,
disabled,
draft,
error
Example:

"active"

Response

200 - application/json

OK response.

management_meta
object
required
Example:
{
"annotations": { "incident.io/terraform/version": "3.0.0" },
"managed_by": "dashboard",
"source_url": "https://github.com/my-company/infrastructure"
}
workflow
object
required
Example:
{
"condition_groups": [
{
"conditions": [
{
"operation": {
"label": "Lawrence Jones",
"value": "01FCQSP07Z74QMMYPDDGQB9FTG"
},
"param_bindings": [
{
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": {
"label": "Incident Severity",
"reference": "incident.severity"
}
}
]
}
],
"continue_on_step_error": true,
"delay": {
"conditions_apply_over_delay": false,
"for_seconds": 60
},
"expressions": [
{
"else_branch": {
"result": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"label": "Team Slack channel",
"operations": [
{
"branches": {
"branches": [
{
"condition_groups": [
{
"conditions": [
{
"operation": {
"label": "Lawrence Jones",
"value": "01FCQSP07Z74QMMYPDDGQB9FTG"
},
"param_bindings": [
{
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": {
"label": "Incident Severity",
"reference": "incident.severity"
}
}
]
}
],
"result": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
],
"returns": { "array": true, "type": "IncidentStatus" }
},
"filter": {
"condition_groups": [
{
"conditions": [
{
"operation": {
"label": "Lawrence Jones",
"value": "01FCQSP07Z74QMMYPDDGQB9FTG"
},
"param_bindings": [
{
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": {
"label": "Incident Severity",
"reference": "incident.severity"
}
}
]
}
]
},
"navigate": {
"reference": "1235",
"reference_label": "Teams"
},
"operation_type": "navigate",
"parse": {
"returns": { "array": true, "type": "IncidentStatus" },
"source": "metadata.annotations[\"github.com/repo\"]"
},
"returns": { "array": true, "type": "IncidentStatus" }
}
],
"reference": "abc123",
"returns": { "array": true, "type": "IncidentStatus" },
"root_reference": "incident.status"
}
],
"folder": "My folder 01",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"include_private_escalations": true,
"include_private_incidents": true,
"name": "My little workflow",
"once_for": [
{
"array": false,
"key": "incident.custom_field[\"01FCNDV6P870EA6S7TK1DSYDG0\"]",
"label": "Incident -> Affected Team",
"type": "IncidentSeverity"
}
],
"runs_from": "2021-08-17T13:28:57.801578Z",
"runs_on_incident_modes": ["standard", "test", "retrospective"],
"runs_on_incidents": "newly_created",
"shortform": "page-the-ceo",
"state": "active",
"steps": [
{
"for_each": "abc123",
"id": "abc123",
"label": "PagerDuty Escalate",
"name": "pagerduty.escalate",
"param_bindings": [
{
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
]
}
],
"trigger": {
"label": "Incident Updated",
"name": "incident.updated"
},
"version": 3
}