Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview of workflow steps before steps are actually executed! #1330

Open
khushwaqt opened this issue Jan 16, 2025 · 1 comment
Open

Preview of workflow steps before steps are actually executed! #1330

khushwaqt opened this issue Jan 16, 2025 · 1 comment

Comments

@khushwaqt
Copy link

Is there a way to analyze the workflow beforehand to provide the user with a preview of what will happen at each step.
lets say I have a workflow which has 3 steps.
Step1 -> Select Users from database
Step2 -> Send email to selected users
Step3 -> Update users in database and update system admin.
I want to simulate each step and display a possible outcome of each step before the user actually starts the workflow.
So in my case based on different inputs in Step1 different group of users will be selected from Database. I want to display a list of users before executing the actual step.

This could be achieved if Input values are fetched from IStepParameter something like

 WorkflowDefinition definition = workflowRegistry.GetDefinition(workflowId, version);
 foreach (var step in definition.Steps)
 {
     if (step.Inputs != null)
     {
         foreach (IStepParameter input in step.Inputs)
         {
             //cant get step inputs here !
         }
     }
 }

but unable to get it to working. Is there any way to achieve this or any work around.

@boeckwi
Copy link

boeckwi commented Feb 23, 2025

You could send a list of the selected users to the admin and use an External Event to wait before continuing with the workflow.

It might also be useful to update every user individually after the send attempt, because if the 1000th email adress has a typo you don't want to resend the 999 users before.

Step1 -> Select Users from database
Step2 -> Inform system admin about pending mails
Step3 -> Wait for external event before continuing
Step4 -> For each mail: Send email and update in database
Step5 -> Inform system admin about success/failured mails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants