The Automation service observes a rate limit and a set of quotas to ensure that all clients get sufficient service and that runaway applications don’t consume excessive resources. APS Rate Limits and Quotas describes rate limits and quotas in general.
The Automation Service applies a per-app rate limit (identified by Client ID) to the GET workitems endpoint used to poll a work item’s status: 150 calls per minute. Exceeding that limit returns an HTTP 429 response.
Because of this limit, avoid polling work item status in a tight loop. Where possible, use the onComplete callback (see POST workitems) to be notified when a work item finishes instead of polling.
Other Automation API endpoints are not individually rate limited per app, but remain subject to the overall service limits of the underlying API gateway.
Automation Service quotas limit an app’s resource consumption when using the Automation API.
Quotas are enforced individually for each app (identified by client ID) that uses the Automation service. Furthermore, quotas apply to the different elements used by the application:
Quota limits may differ depending on the engine the application uses: AutoCAD, Inventor, Revit, 3ds Max, or Fusion.
The quota descriptions that follow each define the element to which the quota applies and the limit for each engine.
These quotas limit a work item’s resource consumption. The quotas are typically different for each engine as listed below.
Quota |
AutoCAD |
Inventor |
Revit |
3ds Max |
Fusion |
Units |
|---|---|---|---|---|---|---|
| Default maximum duration of processing time for a WorkItem. Note: Includes download and upload time | 100 | 900 | 10800 | 3600 | 900 | seconds |
Maximum duration of processing time for a WorkItem that may be specified using the limitProcessingTimeSec attribute (described below). Note: Includes download and upload time |
3600 | 43200 | 43200 | 36000 | 3600 | seconds |
| Maximum permitted size for a WorkItem’s JSON payload | 64 | 64 | 64 | 64 | 64 | KB |
The WorkItem quota is the same across all engines: a WorkItem’s processing time (when it runs an app in an app bundle) cannot exceed one minute without a “heartbeat” to indicate that it is working correctly and not in an infinite loop. The simplest heartbeat is for the app to send output to the standard output (or trace output) stream from your code. However, if you invoke a single operation that is expected to take more than one minute (opening a large file, for example), you can send the output asynchronously. See the Visual Studio Extension code for examples.
These quotas limit resource consumption by activities and app bundles. The quotas can be different for each engine as listed below. Additionally, AppBundles and Activities can be shared by up to 30 other apps.
Quota |
Applies to |
AutoCAD |
Inventor |
Revit |
3ds Max |
Fusion |
Units |
|---|---|---|---|---|---|---|---|
| Maximum uncompressed size of app bundles for each job | App bundle | 500 | 500 | 5000 | 5000 | 500 | MB |
| Maximum number of total versions for app bundles and activities (app bundles and activities counted separately) | App bundles, activities | 100 | 100 | 100 | 100 | 100 | versions |
| Maximum number of total aliases for app bundles and activities (app bundles and activities counted separately) | App bundles, activities | 100 | 100 | 100 | 100 | 100 | aliases |
| Max permitted size of an AppBundle upload | App bundle | 100 | 100 | 100 | 100 | 100 | MB |
| Max permitted size for an activity’s or app bundle’s JSON payload | App bundle, activity | 64 | 64 | 64 | 64 | 64 | KB |
The Automation Service reports quota violations in different ways depending on the type of quota. For work items, the service can’t determine violations when a work item is submitted and put on the job queue. Once the work item is processed, if the work item exceeds a quota then the work item fails. The best practice for determining if a work item has exceeded a quota is to use the OnComplete callback in the GET workitems endpoint and use it to check for work item failure.
Activity and app bundle quota violations are reported in endpoint failure responses after trying to submit or modify an app bundle or activity with parameters that violate a quota.
The Automation API lets you set custom quotas that are lower than the default quotas specified above. Custom quotas can help reduce cloud credit consumption.
Most custom quotas are set using the PUT servicelimits operation. These quotas control WorkItem upload and download limits, upload and download size, processing time, payload size, and other work item limits. The quotas also control app and activity version and alias limits, payload size, and other limits. You can find these custom quotas described in detail in PUT servicelimits.
POST workitems also sets a custom quota through its limitProcessingTimeSec attribute. A WorkItem’s maximum duration of processing time is set by default to a value ranging from 100 to 10800 seconds (as shown in the work item quotas table above) depending on the engine used. limitProcessingTimeSec can change that value for a single work item down or up to a maximum of 400 to 43200 seconds (also shown in the table above) depending on the engine used.
APS by default does not limit the total time each month that an app takes to run automations. If you want to set a monthly limit, use the PUT servicelimits operation to set the limitMonthlyProcessingTimeInHours attribute in frontendLimits. This limits the amount of Automation API specific processing time that the app is allowed to consume each month. If the application reaches the consumption limit, the Automation Service rejects subsequent WorkItems for the remainder of the calendar month.