TypeScript Type Error: Workflows Not Accessible via `internal` API
Issue
When trying to reference workflows defined with
workflowManager.define() through the internal API, TypeScript throws an error saying the workflow property doesn't exist, even though the code works perfectly at runtime.
Code Example
Error Message
Expected Behavior
TypeScript should recognize workflows defined with workflowManager.define() when accessed via internal.workflows.*.private.*, similar to how it recognizes queries, mutations, and actions.
Actual Behavior
- ✅ Code works at runtime
- ❌ TypeScript doesn't recognize workflows through the internal API
- The FilterApi type for internal only includes FunctionReference types, but workflows aren't FunctionReference types
Workaround
Currently using @ts-expect-error to suppress the type error:
Question
Is this a known limitation, or is there a way to properly type workflows so they're recognized through the internal API? This seems like it could affect all workflows, not just this one.
Thanks!3 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!
It might be that you're not running
npx convex dev to generate types during development, could you confirm that it works after running it?No, I definitely am running convex dev
I didn't know it was possible to use convex WITHOUT running it