Execute workflow gives unexpected alert in selenium

Not sure if n8n specific issue, but maybe sb has an idea.

My n8n can execute a python selenium script for web automation.
Workflow A: set some initial data (only when testing), execute the script
Workflow B: set some initial data, call workflow A

Curiously enough the selenium script throws an error only when triggered through the B → A sequence. Adding the execute command node to workflow B directly does work without error.

Traceback of the selenium script execution node says there’s an unexpected alert in the selenium headless browser. I’m curious what could cause the difference in behaviour!

I have a workaround already and it seems to be sth in selenium, so it’s not so crucial, but still I’m wondering…

n8n version: 0.135.1 (–> ok I should probably update also and try again)

Ok it worked once, now the script in the sequence B → A fails with the same alert thing.

I guess I’ll double-check the script locally non-headless and see if there’s an alert that the site I’m trying to automate has a new favorite browser they want me to use or sth like that.

Couldn’t get that alert displayed whatsoever. Tried again in workflow A, now it worked.
I probably just need to take a break and check my data flow.

NodeOperationError: Command failed: cd /root/selenium
python3 myscript.py arg1 arg2 arg3 --flag "arg4"
Traceback (most recent call last):
  File "myscript.py", line 66, in <module>
    login_email = driver.find_element_by_id("txtUserName")
  File "/usr/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 360, in find_element_by_id
    return self.find_element(by=By.ID, value=id_)
  File "/usr/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 976, in find_element
    return self.execute(Command.FIND_ELEMENT, {
  File "/usr/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/usr/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 241, in check_response
    raise exception_class(message, screen, stacktrace, alert_text)
selenium.common.exceptions.UnexpectedAlertPresentException: Alert Text: 
Message: unexpected alert open: {Alert text : }
  (Session info: headless chrome=81.0.4044.113)


    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/ExecuteCommand.node.js:74:27)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:430:47

I restarted my n8n docker container, now it works added directly in workflow B, so I’m going to take that!