Is Deploying a Workflow Idempotent?

Hello :smiley:!

When I run zbctl deploy more than once on the same bpmn file, I see it represented exactly once in the Operate dashboard. Similarly, if I use the go api to deploy a workflow upon start-up of my go client, I still see only one instance of the workflow representedā€¦ which is what I want. So my question is this: when my workflow is unchanged, does deploying it more than once, whether by zbctl or go api, cause a problem? Is deploying the same workflow over and over idempotent? Is there a way to determine if a workflow, given the bpmnProcessId (which seems to be the same as the bpmn file minus .bpmn) already exists and to create it if it doesnā€™t? What is considered best practice?

$ zbctl deploy order-process.bpmn
{
  "key": 2251799813685250,
  "workflows": [
    {
      "bpmnProcessId": "order-process",
      "version": 1,
      "workflowKey": 2251799813685249,
      "resourceName": "order-process.bpmn"
    }
  ]
}
$ zbctl deploy order-process.bpmn
{
  "key": 2251799813685251,
  "workflows": [
    {
      "bpmnProcessId": "order-process",
      "version": 1,
      "workflowKey": 2251799813685249,
      "resourceName": "order-process.bpmn"
    }
  ]
}

Thank you,
Kim.

1 Like

Yes, it is.

1 Like