Hi everyone :wave:, Is it possible to create a ta...
# ask-community
n
Hi everyone 👋, Is it possible to create a task which is triggered based on some external event (e.g. email received, or website updated specific data point, etc)? I wonder how would one go about creating such a flow?:) 🤔
👍 1
👋 1
c
Hi @Newskooler ! It is certainly possible; right now we recommend you use Prefect’s GraphQL API to trigger ad hoc / event driven runs. Check out this blog post for a worked example with AWS Lambda: https://medium.com/the-prefect-blog/event-driven-workflows-with-aws-lambda-2ef9d8cc8f1a
👍 1
v
Hey @Chris White Is it possible to trigger an event from Prefect to other external System in Prefect Core. Also, is it possible to run a task that starts on particular time (based on scheduler) and based on certain task or flow completed or not Sorry @Newskooler for hijacking your discussion thread as I had similar question
n
The more, the merrier. 👌 Thanks, @Chris White!:)
c
Hi @Vipul - anything you can write in Python you can put within a Prefect Task! This includes calling out to external systems, as long as they have some Python SDK / CLI utility you can use within your task.
run a task that starts on particular time (based on scheduler) and based on certain task or flow completed or not
The Prefect scheduler only schedules Flows but of course you can always schedule a single task Flow if you’d like. The other part of your question sounds like standard task dependency resolution - you can definitely specify task dependencies within a Flow. For dependencies on other Flow Run states, I recommend checking out this doc which describes dependencies at the Flow level: https://docs.prefect.io/core/idioms/flow-to-flow.html
v
Thanks @Chris White
s
@Chris White How can we trigger an event based flow in Mutation query with a flow name instead of  flow id. Is there a better supported syntax for triggering a flow with just the flow name. Requesting Guidance for a Code Sample 🙏. This external calling function (python code) will not be part of a prefect task or flow just like your AWS Lambda function