I currently need to have a workflow that runs on a set schedule and I also use the same workflow for on demand runs of this job (it produces a excel with records for an attorney to provide monthly updates.) My original plan was to have it look at the date of the run, and say if run at this date and time, i use the default query path, rather than the dynamic path. I just feel there has to be a better way or variable I can check to know the workflow was started by a schedule, rather than on demand. Thoughts?
Question
Question
better way to have a workflow know it was started by schedule
Replies
The "rulename" token will tell you that. It will have the name of the starting rule (event or scheduled) or say "Started from the Workflow Designer" if manually started.
The token is generated at runtime and not exposed in the token pickers, so you might have to make it visible to other activities by creating a token with Assign Token Values first.
This sounds like exactly what I need but i do not follow how i get this token value as it is not available to me when designing the workflow. I looked around and I added an assign token value widget but could not find this.
You would start with Assign Token Values and create a new token and give it the %(Rulename) token as a value. That will make it available in conditions in subsequent activities.
You'll get a warning about the "non-existent" token when publishing. You can ignore it, the token will be generated when this workflow runs.