Select to view content in your preferred language

Schedule a custom GP tool in Pro?

777
5
Jump to solution
11-15-2023 01:32 PM
gkanazawa_Mpls
New Contributor II

Hi,

I am trying to schedule a few custom geoprocessing tools I recently developed in Python to run overnight in ArcGIS Pro (I have tried in both 3.0 and 3.1). I enter the parameters for the tool and set up the execution schedule in the Geoprocessing pane, and I can then see them in the History pane under 'Scheduled Tools'. The problem is, when the time comes when the scheduled tools are supposed to run, nothing happens - it just sits there, status showing as Active, but does not actually run. When I test the scheduling of a built-in GP tool like Buffer, it executes on schedule just fine. Has anyone else come across this problem? Is it not possible to schedule a GP tool from a custom toolbox? I have confirmed the script to be working as it should when I run it in real time. Any help would be appreciated, thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
gkanazawa_Mpls
New Contributor II

Ok, I (actually, my supervisor) figured out what was wrong. In the toolbox' .pyt file, when the Toolbox class was declared, I didn't have an alias declared in the __init__ function. Apparently Esri's code is broken and produces invalid python for the task if there's no alias, but now that I've added one everything's working as it should! Thanks Dan and Blake for your responses though!

View solution in original post

5 Replies
DanPatterson
MVP Esteemed Contributor

Schedule geoprocessing tools—ArcGIS Pro | Documentation

user type? sign me in automatically?

assuming you are following this


... sort of retired...
0 Kudos
gkanazawa_Mpls
New Contributor II

Yes, I followed the documentation, and 'sign in automatically' is checked on. I do have a Concurrent Use license but I don't think there are any extension tools being used in the script; the only calls to ArcPy are Describe and the .da module.

0 Kudos
BlakeTerhune
MVP Regular Contributor

Schedule geoprocessing tools—ArcGIS Pro | Documentation

Scheduling geoprocessing tools usesWindowsTask Scheduler to run the selected tools at a specified time. The geoprocessing tools you scheduled inArcGIS Prodisplay inWindowsTask Scheduler under the name of the task you specified in theSchedulewindow.

Check to see if it's in Windows Task Scheduler. Check the triggers and actions tabs to make sure everything looks correct. Check the run history of the task to see if it gives you any messaging. Try running it manually from the Windows Task Scheduler.

0 Kudos
gkanazawa_Mpls
New Contributor II

I am able to see it in Task Scheduler, everything looks correct (triggers, actions) except under Last Run Result, it just shows (0x1). If I try to run them manually in Task Scheduler, the Status message changes from Ready to Running, but as far as I can tell it' not actually doing anything.

0 Kudos
gkanazawa_Mpls
New Contributor II

Ok, I (actually, my supervisor) figured out what was wrong. In the toolbox' .pyt file, when the Toolbox class was declared, I didn't have an alias declared in the __init__ function. Apparently Esri's code is broken and produces invalid python for the task if there's no alias, but now that I've added one everything's working as it should! Thanks Dan and Blake for your responses though!