We currently have a workflow that has needs to transfer data from a user’s account to their manager before deleting the user’s account. If the manager does not have an account on the application or is inactive, however, we instead do the transfer to a service account as a fallback.
Right now, this workflow is extremely unwieldy to follow due to the fact that it is almost entirely duplicated steps depending upon if we need to transfer to the manager vs the service account. I am wondering if there is a way to simplify the workflow with some sort of conditional logic for where to do the transfer. My original thought was to do the process as a sub-workflow that we could pass in where the data should be transferred to, but this does not seem to be feasible from my research due to limitations (we would need to pass values back from the child workflow to this one for further processing, and we can’t move that further processing to the child workflow due to the HTTP call needing to return in 90s to avoid a timeout error).
Basically, my thinking would ideally be a conditional for what value we’re using in a define variable step, before we do the HTTP call to the application to do the data transfer. I thought that even somehow doing a first valid transform would work, but that does not seem to be possible either from what I can tell?
I would get the results of Manager check and use “Verify Data Type“ operator to check whether manager does exist. If exists, on True flow send data to manager or False flow send data to Service Account. So, you don’t required any variable here to check this condition if you get a results and an attribute to verify manager status.
@suresh4iam maybe I’m not understanding, but wouldn’t this still require us to duplicate all the post-processing code twice, once for if it was sent to the manager and once if it was sent to the service account? can you elaborate more what you mean?
Apologize for the miscommunication, now I understand your requirement and let me step back what I have given you in earlier comment and as far as I know, unfortunately you cannot use a conditional transform within a the variable to get manager or svc account value since it doesn’t support conditional operator.
But you may use the Compare Strings operator to check the manager account status from the previous steps or from Workflow input and use 2 different HTTP actions to update the data to an application and if you have other common Workflow components without any manager/svc account reference in it, you can link both the HTTP actions to the same action. Something like this,
Workflow Input with manager details
Compare Strings: Compare Manager status
true: HTTP action: Update data to manager
false: HTTP action: Update data to service account
The main problem I’m having is the details in the workflow on the whole “update data to service account” step, since it’s a bit more complicated than that (it’s like 8 steps in the process, not 1). It sounds like there might not be the ability to avoid the duplication though due to the inability to conditionally choose whether to send to the manager vs the service account without having all the steps duplicated like that though.