Repository navigation
feat(workflow): add webhook callback events - #348
Open
ianmacartney wants to merge 3 commits into
Open
ianmacartney wants to merge 3 commits into
ianmacartney wants to merge 3 commits into
Conversation
commit: |
There was a problem hiding this comment.
All reported issues were addressed across 11 files
This PR changes a public API contract. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 8 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/client/index.ts">
<violation number="1" location="src/client/index.ts:411">
P3: This paragraph is currently parsed as part of the `args.timeoutMs` parameter description. Start it with `@remarks` so payload retrieval and authorization guidance appears as general API documentation.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| * `headersStorageId`) or `"discard"` (omit from the event value). | ||
| * @param args.timeoutMs - Optional timeout in milliseconds. If the webhook is | ||
| * not called within this duration, the event fails with error "Timeout". | ||
| * Large payloads can be read via |
There was a problem hiding this comment.
P3: This paragraph is currently parsed as part of the args.timeoutMs parameter description. Start it with @remarks so payload retrieval and authorization guidance appears as general API documentation.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/client/index.ts, line 411:
<comment>This paragraph is currently parsed as part of the `args.timeoutMs` parameter description. Start it with `@remarks` so payload retrieval and authorization guidance appears as general API documentation.</comment>
<file context>
@@ -408,6 +408,10 @@ export async function createEvent<Name extends string>(
* `headersStorageId`) or `"discard"` (omit from the event value).
* @param args.timeoutMs - Optional timeout in milliseconds. If the webhook is
* not called within this duration, the event fails with error "Timeout".
+ * Large payloads can be read via
+ * `ctx.runQuery(component.event.getWebhookPayloadUrl, { eventId, field: "body" })`
+ * (or `field: "headers"`). Fetch the returned URL to read the stored bytes.
</file context>
Suggested change
| * Large payloads can be read via | |
| * @remarks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Workflows can now create a callback URL for an external service and await its response as an event, instead of polling for completion.
createWebhookEventis available as both a standalone helper and aWorkflowManagermethod, returning the event ID, UUID, and full callback URL.Behavior
components.workflow.event.getWebhookPayloadUrl({ eventId, field })viactx.runQuery, after authorizing access in the app. DELETE request bodies are preserved.Timeout.CONVEX_SITE_URLends with a slash or not./workflow/and requiresREPLICATE_API_TOKEN.Release context
This branch was rebased onto current
main. The recommendation is to proceed independently of waiting for component arguments: current Convex supports typed component configuration, and this implementation needs no additional installation arguments beyond the HTTP mount. Component routes must be explicitly exposed withhttpPrefix; the component's systemCONVEX_SITE_URLincludes that mount path. See component HTTP routes and component configuration and HTTP actions.Before publishing, verify the minimum Convex version needed for component HTTP routes and mounted site URLs against the package's existing
^1.46.0peer range, and exercise a mounted callback on a live deployment. Local validation uses Convex 1.51.0; it does not establish compatibility with the oldest allowed peer version. The Replicate integration has not been exercised against the live service. The callback URL is a bearer capability; provider-specific signature verification is not included.Validation
npm run buildnpm test: 177 tests pass, including URL joining, DELETE payloads, credential-free logs, concurrent and sequential delivery, completion after timeout, stored-payload retrieval, and cleanup of awaited and unawaited callbacks across batches.npm run typechecknpm run lint: no errors; three existing query-filter warnings.git diff --checkA follow-up fix commit addresses callback lifecycle, delivery races, credential logging, DELETE bodies, and stored-payload retrieval with regression coverage.