obtoO
Convex Community5mo ago
1 reply
obto

Workflow typings not being generated

I just updated my convex and workflows package and now it seems none of my workflows have typings being built for them? They all show up in the convex dashboard so i know the code works just fine... Any ideas what is going on?

Versions:
@convex-dev/workflow: 0.2.6,
convex: 1.26.2,

In file leads/workflows.ts:
import { v } from "convex/values";
import { internal, components } from "../_generated/api";
import { WorkflowManager } from "@convex-dev/workflow";
import { internalMutation } from "../_generated/server";
const workflow = new WorkflowManager(components.workflow);

export const postProcessLead = workflow.define({
  args: {
    leadId: v.id("leads"),
  },
  handler: async (step, args): Promise<void> => {
    // Get lead to determine organization
    const lead = await step.runQuery(internal.leads.internal.getLeadById, {
      leadId: args.leadId,
    });

    if (!lead) {
      console.error(`Lead ${args.leadId} not found`);
      return;
    }

    // Step 1: Enrich the lead with Apollo data
    await step.runAction(internal.leads.enrich.run, {
      leadId: args.leadId,
    }, { retry: false });

    // Step 2: Geocode the lead
    await step.runAction(internal.leads.geocode.run, {
      leadId: args.leadId,
    }, { retry: true });

    // Step 3: Score the lead using our AI
    await step.runAction(internal.leads.score.generate, {
      leadId: args.leadId,
    }, { retry: true });

    // Step 4: Send webhook notifications
    await step.runAction(internal.notifications.tasks.sendWebhookNotification, {
      organizationId: lead.organizationId,
      leadId: args.leadId,
    }, { retry: true });
  }
});

export const startPostProcessingLead = internalMutation({
  args: {
    leadId: v.id("leads"),
  },
  handler: async (ctx, args) => {
    await workflow.start(
      ctx,
      internal.leads.workflows.postProcessLead,
      { leadId: args.leadId },
      { startAsync: true }
    );
  },
});
Was this page helpful?