I am having a small issue with the preset automation context in my python based automation.
I am trying to get the automation results from previous versions and for that i am extracting the automationID from the context. It seems that the automationID is wrong. It is constant between runs but doesn’t correlate to the automationID set after the run finishes.
What i am doing:
I am logging:
def automate_function(
automate_context: AutomationContext,
function_inputs: FunctionInputs,
) -> None:
...
logger.info(f"Automation ID: {automate_context.automation_run_data.automation_id}")
...
This gives: “cc992b05d0”
After the automation is finished (or even while it is running) i query the data with:
query AutomationData($modelId: String!, $projectId: String!, $versionId: String!) {
project(id: $projectId) {
model(id: $modelId) {
version(id: $versionId) {
automationsStatus {
automationRuns {
functionRuns {
results
status
}
automationId
automation {
id
}
}
}
}
}
}
}
There the automationId is “012b5d1c5c”
I think this is a bug or maybe I misunderstand what the automate_context.automation_run_data should contain.
This also only happens when the automation is deployed. During local testing the automationId is properly set.
-as a small sidenote:
I had a lot of trouble getting the logs at times. My current browser instance for example randomly stopped working and always reports an error. My colleague is able to retrieve the logs.