We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
fireworks

Alteryx API | Associate JobId to ScheduleId

davidflock
5 - Atom

We are currently in the process of building out a PowerBI dashboard to increase visibility to our multitube of Schedules and their inevitable outcome.  We currently have 100+ schedules, and there's no straight-forward or streamlined Server dashboard to help manage this daily.  So, we've decided to hit the Alteryx APIs. 

 

One problem I've stumbled across is being able to associate a specific JobId to a specific ScheduleId.  Most often it isn't an issue, as we can associate a schedule and specific workflowid within the Schedule endpoint.  Then we can reference the workflowId within the Job API endpoint.  It becomes a problem when we have the same workflow associated with multiple schedules.  This part is required as we run the same workflow, multiple times a day at different intervals (the schedule functionality lacks here).  

 

I've attempted to create a custom / unique id with the workflowId and appending the hour of the scheduled workflow.  This comes close as you can do the same within the Job endpoint data.  Though this also has a flaw as the hour data point may change with fall / spring time changes, updating schedule initiation times, queue delay, etc.  When this happens, historical look-back data is screwed.  

 

I haven't found a way to tag custom data to a specific jobId.  Any other thoughts?

2 REPLIES 2
Vinod28
Alteryx
Alteryx

Hi @davidflock ,

Thanks for the question, it’s a common challenge when using the Alteryx APIs.

You’re trying to build a Power BI dashboard to track 100+ schedules. The issue is: when the same workflow is used across multiple schedules, the Jobs API only shows the WorkflowId, not the ScheduleId. So when a job runs, you can’t tell which schedule triggered it, especially when it runs hourly.

You’ve tried matching by scheduled hour, but as you’ve seen, that breaks when:

  • Jobs are delayed

  • Schedule times change

  • Daylight saving kicks in

Since you can’t tag jobs or add metadata, here are the simplest ways to work around it:


1. Use one workflow per schedule

  • Make a copy of the workflow for each schedule (e.g., one per hour).

  • Each copy has its own WorkflowId.

  • When a job runs, you know which schedule triggered it.


2. Pass the schedule name or ID into the workflow

  • Add ScheduleId or ScheduleName as an input when triggering the workflow.

  • Log that value inside the workflow (e.g., to a file or table).

  • Later, match the JobId to that log entry.


3. Match by job start time

  • Use the Jobs API to get the job start time.

  • Compare it to your list of scheduled times.

  • Match to the closest schedule using a small buffer (e.g., ±5 mins).


4. Log the schedule-job mapping separately

  • Keep a table that tracks expected schedule run times.

  • Log actual job runs using a script or controller workflow.

  • Join the two by time or any custom value passed at runtime.


Right now, there’s no API-supported way to directly link JobId to ScheduleId, but happy to help raise this as a product feedback item if you'd like.

 

Blake_E
8 - Asteroid

Hi @davidflock,

 

If you are not a server admin, then you might want to check in with them about accessing the backend database supporting Alteryx Server.  It could be an embedded or enterprise-hosted MongoDB or SQL Server instance depending on your version of Alteryx Server and how your organization is configured.

For forward-looking data about schedules, you might try the Alteryx Gallery scheduleForecasts data for a similar dataset to what populates the Server Admin interface: Schedule Forecast.

 

For history on completed jobs, you might try the Alteryx Service AS_Queue data which includes references to related job, schedule, workflow IDs and job status plus execution time. 

Good luck!