Feature Request: Additional Default Variables

I’ve been really liking the new Parameters feature and it got me thinking about some variables that I define in almost every Workflow and it would be nice if they were there by default. These are the ones that I always use, I’d be interested if other would find them useful or ones that they use.

  • {{$workflow.[Name]}} = the name of the Workflow, I use this in logging and alerting
  • {{[$job].[ID]}} = I use a Pattern Match step to extract this from {{[$job].[ID]}} but I don’t need the full URL, just the ID
  • {{[$job].[StartTime]}} = [Date] that the Job started
1 Like

I found out that {{[$job].[name]}} does exist, so this would be just for the other two variables

2 Likes

Are there particular ways you’re looking to use the job ID + start time? Maybe something report-oriented?

Now you got me questioning all my life choices…

So we log all our Workflows that take actions into Splunk, this is for auditability and for searchability. In the logs we only include the ID just to limit the data. Also, when we Trigger a Workflow using Teams, one of the first steps is to notify Teams that the Workflow started with a link to the Job. We post the URL, but we only display the ID in the link to reduce the data in the chat window for readability.

Start time is also used in logging but also lookbacks in other queries like in Splunk. This would be for things like look back 15minutes in the logs from when the Job started. If the Job takes a minute or two to run, this timeframe would be more consistent than using something like now() in the query.

For reporting I would love to see a timeline count of when Jobs started, looking for spikes in Jobs during a condensed timeframe to indicate abnormal activity happening. Also, trending runtime of a Job over time, looking for drift in execution time either on abnormal execution or increase over time possibly due to resource constraints.

2 Likes