Orchestrator workflows using the vSphere plugin and using example code "taskManager.createCollectorForTasks()" may fail with error "The operation is not allowed in the current state."
Aria Orchestrator 8.18.x
Using the CreateCollectorForTasks method of the TaskManager (or its alternative in the EventManager) creates a TaskHistoryCollector but there is a limited number of those that can exist concurrently. The above error can indicate that the workflow/session has hit that limit.
Detailed in the vSphere SDK Programming Guide.
Use vSphere API option "DestroyCollector" to avoid hitting the the maxCollectors limit in the current vSphere session.
Example workflow command: "collector.destroyCollector()"
Described in vSphere API documentation [Link].