The basic use case of my application is to allow the user to define their own workflow visually by dragging few specific flow chart controls which would involve steps to ask input from the user and do some action.
As an example, consider the following flow chart is built by the user which will ask some prompts and assemble few paragraphs of text to form a letter or document.
I thought I could use Windows Workflow Foundation to allow to define this flow chart. In my thinking I thought to define two custom activities; one for asking something from the user which I call as prompt activities (numbered as 2, 5 and 7 in the above image) and another for appending a document block (numbered as 4, 9, 10 and 11 in the above image) based on the input response for the previous prompt. These prompt custom prompts will have few "in" properties like, the prompt text to be shown, prompt type to indicate whether it is a radio button or drop down or a checkbox, a collection to say what items it has to show in these controls and a "out" variable which is basically the choice that the user made. This choice could be used in the flow chart to decide the execution path.
As a sample to the above, say I set the properties as above, then they will be like:

With this when I invoke the workflow from a web application, I expect to see the following:

Then if I had opted for "No" then a drop down showing as:
and if I had selected the 3rd item, then it should show:
Here, I am basically trying to make the app ask what is being defined in the workflow and based on the input given continue with the workflow and do some tasks.
I am trying this with Windows Workflow Foundation and defined these custom activities. I also created necessary JavaScript functions that would take input and create these radio buttons and show them dynamically. What I miss is connecting the workflow and I am not sure how to do it.
I am not restricted to WWF, I can use any 3rd party solutions as well. I searched in many forums and YouTube videos but could not find the missing link.
Any help is greatly appreciated. Thanks.
Update: Stumbled on something called Bookmarks and may be with that the workflow can be paused and the above can be executed - need to verify, but it would be great if someone who has knowledge on this can shed some light. Thanks.



WWF is pretty old now, you could consider CoreWF (experimental):
https://github.com/UiPath-Open/corewf
Related: Consider that the application you're planning has all of the attributes of designing your own visual Domain Specific Language, therefore I would suggest looking at this problem through a DSL lens, rather than a heavyweight workflow system.
DSLs are very common in systems where business logic needs to change outside of the normal software development process.
If you can't find something online I would recommend https://martinfowler.com/books/dsl.html
The fact that your application is visual programming doesn't change the fact it is still programming, and you'll have to deal with all of the parsing, grammar, syntax checking, and runtime error handling of a regular DSL, in addition to the complications of visual designer.