Email trigger
May I know if there is an email trigger demo on https://app.windmill.dev/? I set it up, but it doesn't look like what I expected. I created a preprocessor to take the incoming the email body , def preprocessor(raw_email: str, parsed_email: dict, wm_trigger: WmTrigger):
text_body = parsed_email.get("text_body") ,
return { "text_body": text_body, } and I created a variable named text_body on the 'input' for receiving the text_body from preprocess, but when I sent an email to the flow, the flow wasn't triggered . May I get any help for the issue ?Thank you for any suggestion and help
text_body = parsed_email.get("text_body") ,
return { "text_body": text_body, } and I created a variable named text_body on the 'input' for receiving the text_body from preprocess, but when I sent an email to the flow, the flow wasn't triggered . May I get any help for the issue ?Thank you for any suggestion and help
10 Replies
that looks correct, did you create an email specific token before copying the email address?
we used to have a warning when no token is set but it seems to not be there anymore, i'll add it back
Yeap, I added a token on it before copying the email address, but sitll doesn't work
and when I keep the flow running , from time to time I will have the error below Canceled: Job canceled: Flow 0195dd2f-0104-d0c1-20ba-da422c57292e (https://app.windmill.dev/run/0195dd2f-0104-d0c1-20ba-da422c57292e?workspace=demo) was cancelled because it was hanging in between 2 steps. Last ping: Some(2025-03-28T14:36:40.073735Z) (now: 2025-03-28 14:38:03.313944 UTC)
This would happen if a worker was interrupted, killed or crashed while doing a state transition at the end of a job which is always an unexpected behavior that should never happen.
Please check your worker logs for more details and feel free to report it to the Windmill team on our Discord or support@windmill.dev (response for non EE customers will be best effort) with as much context as possible, ideally:
- Windmill version
- Worker logs right after the job referenced has finished running
- Is the error consistent when running the same flow
- A minimal flow and its flow.yaml that reproduces the error and that is importable in a fresh workspace
- Your infra setup (helm, docker-compose, configuration of the workers and their number, memory of the database, etc.)
by monitor
That looks like a legit bug in windmill, we will investigate
i will fix the issue when running from the UI (the issue only arises when you have no step inside the flow with a preprocessor)
however i was able to trigger your flow by email so not sure what the issue is
by the way running a flow from the UI won't run the preprocessor, it's only run when triggered externally (e.g. webhook, email, event stream, etc...)
Thank you ,both 🙂 @Hugo C. I have a step to extract the text_body with the preprocessor , but I might not understand what step means here ,so I might miss the step in it . may I know when you sent an email to the flow I created , could it get the text_body and pass it to input ? why can't I do that 😔 ,would you please set up an email trigger flow , so I could test it on app.windill.dev ? thank you
the preprocessor is a special step which is run before the flow any only when triggered externally (aka not from the UI)
if you don't want to use it you can remove the preprocessor step and just add parsed_email as an input to your flow
so when I send an email to u.test_windmill.glad_flow+mrsw23zlmzwg65zoouxhizltorpxo2lomrwws3dmfztwyylel5tgy33xfnke6s2fjzpvit27injekqkuiu@mx.app.windmill.dev, the flow will be triggered, may I know if what I understand is correct, I sent to the address, I don't see the job I just sent from here

the token is not in there, try to recreate a token and copy the email address
Thank you 🙂
np
thanks for the bug report, we were able to find the cause and fix it!