Awaiting webhooks in a workflow
I saw in the workflow doc that you can await on an event. how and where would i define this event?
our use case is awaiting on a webhook that runs within 24 hours and then doing some subsequent computation.
Convex
Workflow
Simplify programming long running code flows. Workflows execute durably with configurable retries and delays.
4 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
I haven't used the Workflow component yet, but I can understand the confusion 'cause I don't think the docs are very clear on event dependency.
As I read it, though, you first name a step, and then you reference that name when using
ctx.awaitEvent. (If I'm wrong and someone knows the correct approach, please chime in.)
That said, I don't think that will work in your use case because you're waiting for a webhook, not another function that you're calling directly from within the workflow. My gut says that you'll need to trigger an action to make the API call will eventually lead to the webhook. When the webhook (a Convex HTTP action) is called, it would kick off a new workflow with the remaining steps.
Does that make sense?Convex
Workflow
Simplify programming long running code flows. Workflows execute durably with configurable retries and delays.
That makes sense! Want to confirm this with someone on the team as well.
Do you know the best person to reach out to here?
Rather than going to a specific person, I recommend asking in the #components channel. Whichever team member made that component will most likely respond.