@convex-dev/workflow
Version:
Convex component for durably executing workflows.
1,167 lines • 69.4 kB
TypeScript
import { type Infer } from "convex/values";
export declare const vOnComplete: import("convex/values").VObject<{
context?: any;
fnHandle: string;
}, {
fnHandle: import("convex/values").VString<string, "required">;
context: import("convex/values").VAny<any, "optional", string>;
}, "required", "context" | `context.${string}` | "fnHandle">;
export declare const workflowDocument: import("convex/values").VObject<{
name?: string | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
startedAt?: null | undefined;
onComplete?: {
context?: any;
fnHandle: string;
} | undefined;
logLevel?: null | undefined;
state?: null | undefined;
args: any;
_id: string;
_creationTime: number;
workflowHandle: string;
generationNumber: number;
}, {
name: import("convex/values").VString<string | undefined, "optional">;
workflowHandle: import("convex/values").VString<string, "required">;
args: import("convex/values").VAny<any, "required", string>;
onComplete: import("convex/values").VObject<{
context?: any;
fnHandle: string;
} | undefined, {
fnHandle: import("convex/values").VString<string, "required">;
context: import("convex/values").VAny<any, "optional", string>;
}, "optional", "context" | `context.${string}` | "fnHandle">;
logLevel: import("convex/values").Validator<null, "optional">;
startedAt: import("convex/values").Validator<null, "optional">;
state: import("convex/values").Validator<null, "optional">;
runResult: import("convex/values").VUnion<{
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined, [import("convex/values").VObject<{
kind: "success";
returnValue: any;
}, {
kind: import("convex/values").VLiteral<"success", "required">;
returnValue: import("convex/values").VAny<any, "required", string>;
}, "required", "kind" | "returnValue" | `returnValue.${string}`>, import("convex/values").VObject<{
kind: "failed";
error: string;
}, {
kind: import("convex/values").VLiteral<"failed", "required">;
error: import("convex/values").VString<string, "required">;
}, "required", "kind" | "error">, import("convex/values").VObject<{
kind: "canceled";
}, {
kind: import("convex/values").VLiteral<"canceled", "required">;
}, "required", "kind">], "optional", "kind" | "returnValue" | `returnValue.${string}` | "error">;
generationNumber: import("convex/values").VFloat64<number, "required">;
_id: import("convex/values").VString<string, "required">;
_creationTime: import("convex/values").VFloat64<number, "required">;
}, "required", "name" | "args" | "runResult" | `args.${string}` | "runResult.kind" | "runResult.returnValue" | `runResult.returnValue.${string}` | "runResult.error" | "startedAt" | "_id" | "_creationTime" | "workflowHandle" | "onComplete" | "logLevel" | "state" | "generationNumber" | `startedAt.${string}` | "onComplete.context" | `onComplete.context.${string}` | "onComplete.fnHandle" | `logLevel.${string}` | `state.${string}`>;
export type Workflow = Infer<typeof workflowDocument>;
export declare const step: import("convex/values").VUnion<{
kind?: "function" | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
workId?: import("@convex-dev/workpool").WorkId | undefined;
name: string;
args: any;
startedAt: number;
functionType: "mutation" | "query" | "action";
handle: string;
inProgress: boolean;
argsSize: number;
} | {
workflowId?: import("convex/values").GenericId<"workflows"> | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
kind: "workflow";
name: string;
args: any;
startedAt: number;
handle: string;
inProgress: boolean;
argsSize: number;
} | {
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
eventId?: import("convex/values").GenericId<"events"> | undefined;
kind: "event";
name: string;
args: {
eventId?: import("convex/values").GenericId<"events"> | undefined;
};
startedAt: number;
inProgress: boolean;
argsSize: number;
} | {
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
workId?: import("@convex-dev/workpool").WorkId | undefined;
kind: "sleep";
name: string;
args: any;
startedAt: number;
inProgress: boolean;
argsSize: number;
}, [import("convex/values").VObject<{
kind?: "function" | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
workId?: import("@convex-dev/workpool").WorkId | undefined;
name: string;
args: any;
startedAt: number;
functionType: "mutation" | "query" | "action";
handle: string;
inProgress: boolean;
argsSize: number;
}, {
name: import("convex/values").VString<string, "required">;
inProgress: import("convex/values").VBoolean<boolean, "required">;
argsSize: import("convex/values").VFloat64<number, "required">;
args: import("convex/values").VAny<any, "required", string>;
runResult: import("convex/values").VUnion<{
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined, [import("convex/values").VObject<{
kind: "success";
returnValue: any;
}, {
kind: import("convex/values").VLiteral<"success", "required">;
returnValue: import("convex/values").VAny<any, "required", string>;
}, "required", "kind" | "returnValue" | `returnValue.${string}`>, import("convex/values").VObject<{
kind: "failed";
error: string;
}, {
kind: import("convex/values").VLiteral<"failed", "required">;
error: import("convex/values").VString<string, "required">;
}, "required", "kind" | "error">, import("convex/values").VObject<{
kind: "canceled";
}, {
kind: import("convex/values").VLiteral<"canceled", "required">;
}, "required", "kind">], "optional", "kind" | "returnValue" | `returnValue.${string}` | "error">;
startedAt: import("convex/values").VFloat64<number, "required">;
completedAt: import("convex/values").VFloat64<number | undefined, "optional">;
kind: import("convex/values").VLiteral<"function" | undefined, "optional">;
functionType: import("convex/values").VUnion<"mutation" | "query" | "action", NoInfer<[import("convex/values").VLiteral<"query", "required">, import("convex/values").VLiteral<"mutation", "required">, import("convex/values").VLiteral<"action", "required">]>, "required", never>;
handle: import("convex/values").VString<string, "required">;
workId: import("convex/values").VString<import("@convex-dev/workpool").WorkId | undefined, "optional">;
}, "required", "kind" | "name" | "args" | "runResult" | `args.${string}` | "runResult.kind" | "runResult.returnValue" | `runResult.returnValue.${string}` | "runResult.error" | "startedAt" | "completedAt" | "workId" | "functionType" | "handle" | "inProgress" | "argsSize">, import("convex/values").VObject<{
workflowId?: import("convex/values").GenericId<"workflows"> | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
kind: "workflow";
name: string;
args: any;
startedAt: number;
handle: string;
inProgress: boolean;
argsSize: number;
}, {
name: import("convex/values").VString<string, "required">;
inProgress: import("convex/values").VBoolean<boolean, "required">;
argsSize: import("convex/values").VFloat64<number, "required">;
args: import("convex/values").VAny<any, "required", string>;
runResult: import("convex/values").VUnion<{
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined, [import("convex/values").VObject<{
kind: "success";
returnValue: any;
}, {
kind: import("convex/values").VLiteral<"success", "required">;
returnValue: import("convex/values").VAny<any, "required", string>;
}, "required", "kind" | "returnValue" | `returnValue.${string}`>, import("convex/values").VObject<{
kind: "failed";
error: string;
}, {
kind: import("convex/values").VLiteral<"failed", "required">;
error: import("convex/values").VString<string, "required">;
}, "required", "kind" | "error">, import("convex/values").VObject<{
kind: "canceled";
}, {
kind: import("convex/values").VLiteral<"canceled", "required">;
}, "required", "kind">], "optional", "kind" | "returnValue" | `returnValue.${string}` | "error">;
startedAt: import("convex/values").VFloat64<number, "required">;
completedAt: import("convex/values").VFloat64<number | undefined, "optional">;
kind: import("convex/values").VLiteral<"workflow", "required">;
handle: import("convex/values").VString<string, "required">;
workflowId: import("convex/values").VId<import("convex/values").GenericId<"workflows"> | undefined, "optional">;
}, "required", "kind" | "workflowId" | "name" | "args" | "runResult" | `args.${string}` | "runResult.kind" | "runResult.returnValue" | `runResult.returnValue.${string}` | "runResult.error" | "startedAt" | "completedAt" | "handle" | "inProgress" | "argsSize">, import("convex/values").VObject<{
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
eventId?: import("convex/values").GenericId<"events"> | undefined;
kind: "event";
name: string;
args: {
eventId?: import("convex/values").GenericId<"events"> | undefined;
};
startedAt: number;
inProgress: boolean;
argsSize: number;
}, {
eventId: import("convex/values").VId<import("convex/values").GenericId<"events"> | undefined, "optional">;
args: import("convex/values").VObject<{
eventId?: import("convex/values").GenericId<"events"> | undefined;
}, {
eventId: import("convex/values").VId<import("convex/values").GenericId<"events"> | undefined, "optional">;
}, "required", "eventId">;
name: import("convex/values").VString<string, "required">;
inProgress: import("convex/values").VBoolean<boolean, "required">;
argsSize: import("convex/values").VFloat64<number, "required">;
runResult: import("convex/values").VUnion<{
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined, [import("convex/values").VObject<{
kind: "success";
returnValue: any;
}, {
kind: import("convex/values").VLiteral<"success", "required">;
returnValue: import("convex/values").VAny<any, "required", string>;
}, "required", "kind" | "returnValue" | `returnValue.${string}`>, import("convex/values").VObject<{
kind: "failed";
error: string;
}, {
kind: import("convex/values").VLiteral<"failed", "required">;
error: import("convex/values").VString<string, "required">;
}, "required", "kind" | "error">, import("convex/values").VObject<{
kind: "canceled";
}, {
kind: import("convex/values").VLiteral<"canceled", "required">;
}, "required", "kind">], "optional", "kind" | "returnValue" | `returnValue.${string}` | "error">;
startedAt: import("convex/values").VFloat64<number, "required">;
completedAt: import("convex/values").VFloat64<number | undefined, "optional">;
kind: import("convex/values").VLiteral<"event", "required">;
}, "required", "kind" | "name" | "args" | "runResult" | "runResult.kind" | "runResult.returnValue" | `runResult.returnValue.${string}` | "runResult.error" | "startedAt" | "completedAt" | "eventId" | "inProgress" | "argsSize" | "args.eventId">, import("convex/values").VObject<{
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
workId?: import("@convex-dev/workpool").WorkId | undefined;
kind: "sleep";
name: string;
args: any;
startedAt: number;
inProgress: boolean;
argsSize: number;
}, {
name: import("convex/values").VString<string, "required">;
inProgress: import("convex/values").VBoolean<boolean, "required">;
argsSize: import("convex/values").VFloat64<number, "required">;
args: import("convex/values").VAny<any, "required", string>;
runResult: import("convex/values").VUnion<{
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined, [import("convex/values").VObject<{
kind: "success";
returnValue: any;
}, {
kind: import("convex/values").VLiteral<"success", "required">;
returnValue: import("convex/values").VAny<any, "required", string>;
}, "required", "kind" | "returnValue" | `returnValue.${string}`>, import("convex/values").VObject<{
kind: "failed";
error: string;
}, {
kind: import("convex/values").VLiteral<"failed", "required">;
error: import("convex/values").VString<string, "required">;
}, "required", "kind" | "error">, import("convex/values").VObject<{
kind: "canceled";
}, {
kind: import("convex/values").VLiteral<"canceled", "required">;
}, "required", "kind">], "optional", "kind" | "returnValue" | `returnValue.${string}` | "error">;
startedAt: import("convex/values").VFloat64<number, "required">;
completedAt: import("convex/values").VFloat64<number | undefined, "optional">;
kind: import("convex/values").VLiteral<"sleep", "required">;
workId: import("convex/values").VString<import("@convex-dev/workpool").WorkId | undefined, "optional">;
}, "required", "kind" | "name" | "args" | "runResult" | `args.${string}` | "runResult.kind" | "runResult.returnValue" | `runResult.returnValue.${string}` | "runResult.error" | "startedAt" | "completedAt" | "workId" | "inProgress" | "argsSize">], "required", "kind" | "workflowId" | "name" | "args" | "runResult" | `args.${string}` | "runResult.kind" | "runResult.returnValue" | `runResult.returnValue.${string}` | "runResult.error" | "startedAt" | "completedAt" | "workId" | "eventId" | "functionType" | "handle" | "inProgress" | "argsSize">;
export type Step = Infer<typeof step>;
export declare const journalDocument: import("convex/values").VObject<{
workflowId: import("convex/values").GenericId<"workflows">;
stepNumber: number;
_id: string;
_creationTime: number;
step: {
kind?: "function" | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
workId?: import("@convex-dev/workpool").WorkId | undefined;
name: string;
args: any;
startedAt: number;
functionType: "mutation" | "query" | "action";
handle: string;
inProgress: boolean;
argsSize: number;
} | {
workflowId?: import("convex/values").GenericId<"workflows"> | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
kind: "workflow";
name: string;
args: any;
startedAt: number;
handle: string;
inProgress: boolean;
argsSize: number;
} | {
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
eventId?: import("convex/values").GenericId<"events"> | undefined;
kind: "event";
name: string;
args: {
eventId?: import("convex/values").GenericId<"events"> | undefined;
};
startedAt: number;
inProgress: boolean;
argsSize: number;
} | {
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
workId?: import("@convex-dev/workpool").WorkId | undefined;
kind: "sleep";
name: string;
args: any;
startedAt: number;
inProgress: boolean;
argsSize: number;
};
}, {
workflowId: import("convex/values").VId<import("convex/values").GenericId<"workflows">, "required">;
stepNumber: import("convex/values").VFloat64<number, "required">;
step: import("convex/values").VUnion<{
kind?: "function" | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
workId?: import("@convex-dev/workpool").WorkId | undefined;
name: string;
args: any;
startedAt: number;
functionType: "mutation" | "query" | "action";
handle: string;
inProgress: boolean;
argsSize: number;
} | {
workflowId?: import("convex/values").GenericId<"workflows"> | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
kind: "workflow";
name: string;
args: any;
startedAt: number;
handle: string;
inProgress: boolean;
argsSize: number;
} | {
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
eventId?: import("convex/values").GenericId<"events"> | undefined;
kind: "event";
name: string;
args: {
eventId?: import("convex/values").GenericId<"events"> | undefined;
};
startedAt: number;
inProgress: boolean;
argsSize: number;
} | {
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
workId?: import("@convex-dev/workpool").WorkId | undefined;
kind: "sleep";
name: string;
args: any;
startedAt: number;
inProgress: boolean;
argsSize: number;
}, [import("convex/values").VObject<{
kind?: "function" | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
workId?: import("@convex-dev/workpool").WorkId | undefined;
name: string;
args: any;
startedAt: number;
functionType: "mutation" | "query" | "action";
handle: string;
inProgress: boolean;
argsSize: number;
}, {
name: import("convex/values").VString<string, "required">;
inProgress: import("convex/values").VBoolean<boolean, "required">;
argsSize: import("convex/values").VFloat64<number, "required">;
args: import("convex/values").VAny<any, "required", string>;
runResult: import("convex/values").VUnion<{
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined, [import("convex/values").VObject<{
kind: "success";
returnValue: any;
}, {
kind: import("convex/values").VLiteral<"success", "required">;
returnValue: import("convex/values").VAny<any, "required", string>;
}, "required", "kind" | "returnValue" | `returnValue.${string}`>, import("convex/values").VObject<{
kind: "failed";
error: string;
}, {
kind: import("convex/values").VLiteral<"failed", "required">;
error: import("convex/values").VString<string, "required">;
}, "required", "kind" | "error">, import("convex/values").VObject<{
kind: "canceled";
}, {
kind: import("convex/values").VLiteral<"canceled", "required">;
}, "required", "kind">], "optional", "kind" | "returnValue" | `returnValue.${string}` | "error">;
startedAt: import("convex/values").VFloat64<number, "required">;
completedAt: import("convex/values").VFloat64<number | undefined, "optional">;
kind: import("convex/values").VLiteral<"function" | undefined, "optional">;
functionType: import("convex/values").VUnion<"mutation" | "query" | "action", NoInfer<[import("convex/values").VLiteral<"query", "required">, import("convex/values").VLiteral<"mutation", "required">, import("convex/values").VLiteral<"action", "required">]>, "required", never>;
handle: import("convex/values").VString<string, "required">;
workId: import("convex/values").VString<import("@convex-dev/workpool").WorkId | undefined, "optional">;
}, "required", "kind" | "name" | "args" | "runResult" | `args.${string}` | "runResult.kind" | "runResult.returnValue" | `runResult.returnValue.${string}` | "runResult.error" | "startedAt" | "completedAt" | "workId" | "functionType" | "handle" | "inProgress" | "argsSize">, import("convex/values").VObject<{
workflowId?: import("convex/values").GenericId<"workflows"> | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
kind: "workflow";
name: string;
args: any;
startedAt: number;
handle: string;
inProgress: boolean;
argsSize: number;
}, {
name: import("convex/values").VString<string, "required">;
inProgress: import("convex/values").VBoolean<boolean, "required">;
argsSize: import("convex/values").VFloat64<number, "required">;
args: import("convex/values").VAny<any, "required", string>;
runResult: import("convex/values").VUnion<{
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined, [import("convex/values").VObject<{
kind: "success";
returnValue: any;
}, {
kind: import("convex/values").VLiteral<"success", "required">;
returnValue: import("convex/values").VAny<any, "required", string>;
}, "required", "kind" | "returnValue" | `returnValue.${string}`>, import("convex/values").VObject<{
kind: "failed";
error: string;
}, {
kind: import("convex/values").VLiteral<"failed", "required">;
error: import("convex/values").VString<string, "required">;
}, "required", "kind" | "error">, import("convex/values").VObject<{
kind: "canceled";
}, {
kind: import("convex/values").VLiteral<"canceled", "required">;
}, "required", "kind">], "optional", "kind" | "returnValue" | `returnValue.${string}` | "error">;
startedAt: import("convex/values").VFloat64<number, "required">;
completedAt: import("convex/values").VFloat64<number | undefined, "optional">;
kind: import("convex/values").VLiteral<"workflow", "required">;
handle: import("convex/values").VString<string, "required">;
workflowId: import("convex/values").VId<import("convex/values").GenericId<"workflows"> | undefined, "optional">;
}, "required", "kind" | "workflowId" | "name" | "args" | "runResult" | `args.${string}` | "runResult.kind" | "runResult.returnValue" | `runResult.returnValue.${string}` | "runResult.error" | "startedAt" | "completedAt" | "handle" | "inProgress" | "argsSize">, import("convex/values").VObject<{
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
eventId?: import("convex/values").GenericId<"events"> | undefined;
kind: "event";
name: string;
args: {
eventId?: import("convex/values").GenericId<"events"> | undefined;
};
startedAt: number;
inProgress: boolean;
argsSize: number;
}, {
eventId: import("convex/values").VId<import("convex/values").GenericId<"events"> | undefined, "optional">;
args: import("convex/values").VObject<{
eventId?: import("convex/values").GenericId<"events"> | undefined;
}, {
eventId: import("convex/values").VId<import("convex/values").GenericId<"events"> | undefined, "optional">;
}, "required", "eventId">;
name: import("convex/values").VString<string, "required">;
inProgress: import("convex/values").VBoolean<boolean, "required">;
argsSize: import("convex/values").VFloat64<number, "required">;
runResult: import("convex/values").VUnion<{
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined, [import("convex/values").VObject<{
kind: "success";
returnValue: any;
}, {
kind: import("convex/values").VLiteral<"success", "required">;
returnValue: import("convex/values").VAny<any, "required", string>;
}, "required", "kind" | "returnValue" | `returnValue.${string}`>, import("convex/values").VObject<{
kind: "failed";
error: string;
}, {
kind: import("convex/values").VLiteral<"failed", "required">;
error: import("convex/values").VString<string, "required">;
}, "required", "kind" | "error">, import("convex/values").VObject<{
kind: "canceled";
}, {
kind: import("convex/values").VLiteral<"canceled", "required">;
}, "required", "kind">], "optional", "kind" | "returnValue" | `returnValue.${string}` | "error">;
startedAt: import("convex/values").VFloat64<number, "required">;
completedAt: import("convex/values").VFloat64<number | undefined, "optional">;
kind: import("convex/values").VLiteral<"event", "required">;
}, "required", "kind" | "name" | "args" | "runResult" | "runResult.kind" | "runResult.returnValue" | `runResult.returnValue.${string}` | "runResult.error" | "startedAt" | "completedAt" | "eventId" | "inProgress" | "argsSize" | "args.eventId">, import("convex/values").VObject<{
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
workId?: import("@convex-dev/workpool").WorkId | undefined;
kind: "sleep";
name: string;
args: any;
startedAt: number;
inProgress: boolean;
argsSize: number;
}, {
name: import("convex/values").VString<string, "required">;
inProgress: import("convex/values").VBoolean<boolean, "required">;
argsSize: import("convex/values").VFloat64<number, "required">;
args: import("convex/values").VAny<any, "required", string>;
runResult: import("convex/values").VUnion<{
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined, [import("convex/values").VObject<{
kind: "success";
returnValue: any;
}, {
kind: import("convex/values").VLiteral<"success", "required">;
returnValue: import("convex/values").VAny<any, "required", string>;
}, "required", "kind" | "returnValue" | `returnValue.${string}`>, import("convex/values").VObject<{
kind: "failed";
error: string;
}, {
kind: import("convex/values").VLiteral<"failed", "required">;
error: import("convex/values").VString<string, "required">;
}, "required", "kind" | "error">, import("convex/values").VObject<{
kind: "canceled";
}, {
kind: import("convex/values").VLiteral<"canceled", "required">;
}, "required", "kind">], "optional", "kind" | "returnValue" | `returnValue.${string}` | "error">;
startedAt: import("convex/values").VFloat64<number, "required">;
completedAt: import("convex/values").VFloat64<number | undefined, "optional">;
kind: import("convex/values").VLiteral<"sleep", "required">;
workId: import("convex/values").VString<import("@convex-dev/workpool").WorkId | undefined, "optional">;
}, "required", "kind" | "name" | "args" | "runResult" | `args.${string}` | "runResult.kind" | "runResult.returnValue" | `runResult.returnValue.${string}` | "runResult.error" | "startedAt" | "completedAt" | "workId" | "inProgress" | "argsSize">], "required", "kind" | "workflowId" | "name" | "args" | "runResult" | `args.${string}` | "runResult.kind" | "runResult.returnValue" | `runResult.returnValue.${string}` | "runResult.error" | "startedAt" | "completedAt" | "workId" | "eventId" | "functionType" | "handle" | "inProgress" | "argsSize">;
_id: import("convex/values").VString<string, "required">;
_creationTime: import("convex/values").VFloat64<number, "required">;
}, "required", "workflowId" | "stepNumber" | "_id" | "_creationTime" | "step" | "step.kind" | "step.workflowId" | "step.name" | "step.args" | "step.runResult" | `step.args.${string}` | "step.runResult.kind" | "step.runResult.returnValue" | `step.runResult.returnValue.${string}` | "step.runResult.error" | "step.startedAt" | "step.completedAt" | "step.workId" | "step.eventId" | "step.functionType" | "step.handle" | "step.inProgress" | "step.argsSize">;
export type JournalEntry = Infer<typeof journalDocument>;
export declare const event: {
workflowId: import("convex/values").VId<import("convex/values").GenericId<"workflows">, "required">;
name: import("convex/values").VString<string, "required">;
state: import("convex/values").VUnion<{
kind: "created";
} | {
kind: "sent";
result: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
};
sentAt: number;
} | {
kind: "waiting";
stepId: import("convex/values").GenericId<"steps">;
waitingAt: number;
} | {
kind: "consumed";
stepId: import("convex/values").GenericId<"steps">;
sentAt: number;
waitingAt: number;
consumedAt: number;
}, [import("convex/values").VObject<{
kind: "created";
}, {
kind: import("convex/values").VLiteral<"created", "required">;
}, "required", "kind">, import("convex/values").VObject<{
kind: "sent";
result: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
};
sentAt: number;
}, {
kind: import("convex/values").VLiteral<"sent", "required">;
result: import("convex/values").VUnion<{
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
}, [import("convex/values").VObject<{
kind: "success";
returnValue: any;
}, {
kind: import("convex/values").VLiteral<"success", "required">;
returnValue: import("convex/values").VAny<any, "required", string>;
}, "required", "kind" | "returnValue" | `returnValue.${string}`>, import("convex/values").VObject<{
kind: "failed";
error: string;
}, {
kind: import("convex/values").VLiteral<"failed", "required">;
error: import("convex/values").VString<string, "required">;
}, "required", "kind" | "error">, import("convex/values").VObject<{
kind: "canceled";
}, {
kind: import("convex/values").VLiteral<"canceled", "required">;
}, "required", "kind">], "required", "kind" | "returnValue" | `returnValue.${string}` | "error">;
sentAt: import("convex/values").VFloat64<number, "required">;
}, "required", "kind" | "result" | "sentAt" | "result.kind" | "result.returnValue" | `result.returnValue.${string}` | "result.error">, import("convex/values").VObject<{
kind: "waiting";
stepId: import("convex/values").GenericId<"steps">;
waitingAt: number;
}, {
kind: import("convex/values").VLiteral<"waiting", "required">;
waitingAt: import("convex/values").VFloat64<number, "required">;
stepId: import("convex/values").VId<import("convex/values").GenericId<"steps">, "required">;
}, "required", "kind" | "stepId" | "waitingAt">, import("convex/values").VObject<{
kind: "consumed";
stepId: import("convex/values").GenericId<"steps">;
sentAt: number;
waitingAt: number;
consumedAt: number;
}, {
kind: import("convex/values").VLiteral<"consumed", "required">;
waitingAt: import("convex/values").VFloat64<number, "required">;
sentAt: import("convex/values").VFloat64<number, "required">;
consumedAt: import("convex/values").VFloat64<number, "required">;
stepId: import("convex/values").VId<import("convex/values").GenericId<"steps">, "required">;
}, "required", "kind" | "stepId" | "sentAt" | "waitingAt" | "consumedAt">], "required", "kind" | "stepId" | "result" | "sentAt" | "result.kind" | "result.returnValue" | `result.returnValue.${string}` | "result.error" | "waitingAt" | "consumedAt">;
};
declare const _default: import("convex/server").SchemaDefinition<{
config: import("convex/server").TableDefinition<import("convex/values").VObject<{
logLevel?: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR" | undefined;
maxParallelism?: number | undefined;
}, {
logLevel: import("convex/values").VUnion<"DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR" | undefined, [import("convex/values").VLiteral<"DEBUG", "required">, import("convex/values").VLiteral<"TRACE", "required">, import("convex/values").VLiteral<"INFO", "required">, import("convex/values").VLiteral<"REPORT", "required">, import("convex/values").VLiteral<"WARN", "required">, import("convex/values").VLiteral<"ERROR", "required">], "optional", never>;
maxParallelism: import("convex/values").VFloat64<number | undefined, "optional">;
}, "required", "logLevel" | "maxParallelism">, {}, {}, {}>;
workflows: import("convex/server").TableDefinition<import("convex/values").VObject<{
name?: string | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
startedAt?: null | undefined;
onComplete?: {
context?: any;
fnHandle: string;
} | undefined;
logLevel?: null | undefined;
state?: null | undefined;
args: any;
workflowHandle: string;
generationNumber: number;
}, {
name: import("convex/values").VString<string | undefined, "optional">;
workflowHandle: import("convex/values").VString<string, "required">;
args: import("convex/values").VAny<any, "required", string>;
onComplete: import("convex/values").VObject<{
context?: any;
fnHandle: string;
} | undefined, {
fnHandle: import("convex/values").VString<string, "required">;
context: import("convex/values").VAny<any, "optional", string>;
}, "optional", "context" | `context.${string}` | "fnHandle">;
logLevel: import("convex/values").Validator<null, "optional">;
startedAt: import("convex/values").Validator<null, "optional">;
state: import("convex/values").Validator<null, "optional">;
runResult: import("convex/values").VUnion<{
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined, [import("convex/values").VObject<{
kind: "success";
returnValue: any;
}, {
kind: import("convex/values").VLiteral<"success", "required">;
returnValue: import("convex/values").VAny<any, "required", string>;
}, "required", "kind" | "returnValue" | `returnValue.${string}`>, import("convex/values").VObject<{
kind: "failed";
error: string;
}, {
kind: import("convex/values").VLiteral<"failed", "required">;
error: import("convex/values").VString<string, "required">;
}, "required", "kind" | "error">, import("convex/values").VObject<{
kind: "canceled";
}, {
kind: import("convex/values").VLiteral<"canceled", "required">;
}, "required", "kind">], "optional", "kind" | "returnValue" | `returnValue.${string}` | "error">;
generationNumber: import("convex/values").VFloat64<number, "required">;
}, "required", "name" | "args" | "runResult" | `args.${string}` | "runResult.kind" | "runResult.returnValue" | `runResult.returnValue.${string}` | "runResult.error" | "startedAt" | "workflowHandle" | "onComplete" | "logLevel" | "state" | "generationNumber" | `startedAt.${string}` | "onComplete.context" | `onComplete.context.${string}` | "onComplete.fnHandle" | `logLevel.${string}` | `state.${string}`>, {
name: ["name", "_creationTime"];
}, {}, {}>;
steps: import("convex/server").TableDefinition<import("convex/values").VObject<{
workflowId: import("convex/values").GenericId<"workflows">;
stepNumber: number;
step: {
kind?: "function" | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
workId?: import("@convex-dev/workpool").WorkId | undefined;
name: string;
args: any;
startedAt: number;
functionType: "mutation" | "query" | "action";
handle: string;
inProgress: boolean;
argsSize: number;
} | {
workflowId?: import("convex/values").GenericId<"workflows"> | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
kind: "workflow";
name: string;
args: any;
startedAt: number;
handle: string;
inProgress: boolean;
argsSize: number;
} | {
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
eventId?: import("convex/values").GenericId<"events"> | undefined;
kind: "event";
name: string;
args: {
eventId?: import("convex/values").GenericId<"events"> | undefined;
};
startedAt: number;
inProgress: boolean;
argsSize: number;
} | {
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
workId?: import("@convex-dev/workpool").WorkId | undefined;
kind: "sleep";
name: string;
args: any;
startedAt: number;
inProgress: boolean;
argsSize: number;
};
}, {
workflowId: import("convex/values").VId<import("convex/values").GenericId<"workflows">, "required">;
stepNumber: import("convex/values").VFloat64<number, "required">;
step: import("convex/values").VUnion<{
kind?: "function" | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
workId?: import("@convex-dev/workpool").WorkId | undefined;
name: string;
args: any;
startedAt: number;
functionType: "mutation" | "query" | "action";
handle: string;
inProgress: boolean;
argsSize: number;
} | {
workflowId?: import("convex/values").GenericId<"workflows"> | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
kind: "workflow";
name: string;
args: any;
startedAt: number;
handle: string;
inProgress: boolean;
argsSize: number;
} | {
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
eventId?: import("convex/values").GenericId<"events"> | undefined;
kind: "event";
name: string;
args: {
eventId?: import("convex/values").GenericId<"events"> | undefined;
};
startedAt: number;
inProgress: boolean;
argsSize: number;
} | {
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
workId?: import("@convex-dev/workpool").WorkId | undefined;
kind: "sleep";
name: string;
args: any;
startedAt: number;
inProgress: boolean;
argsSize: number;
}, [import("convex/values").VObject<{
kind?: "function" | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
workId?: import("@convex-dev/workpool").WorkId | undefined;
name: string;
args: any;
startedAt: number;
functionType: "mutation" | "query" | "action";
handle: string;
inProgress: boolean;
argsSize: number;
}, {
name: import("convex/values").VString<string, "required">;
inProgress: import("convex/values").VBoolean<boolean, "required">;
argsSize: import("convex/values").VFloat64<number, "required">;
args: import("convex/values").VAny<any, "required", string>;
runResult: import("convex/values").VUnion<{
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined, [import("convex/values").VObject<{
kind: "success";
returnValue: any;
}, {
kind: import("convex/values").VLiteral<"success", "required">;
returnValue: import("convex/values").VAny<any, "required", string>;
}, "required", "kind" | "returnValue" | `returnValue.${string}`>, import("convex/values").VObject<{
kind: "failed";
error: string;
}, {
kind: import("convex/values").VLiteral<"failed", "required">;
error: import("convex/values").VString<string, "required">;
}, "required", "kind" | "error">, import("convex/values").VObject<{
kind: "canceled";
}, {
kind: import("convex/values").VLiteral<"canceled", "required">;
}, "required", "kind">], "optional", "kind" | "returnValue" | `returnValue.${string}` | "error">;
startedAt: import("convex/values").VFloat64<number, "required">;
completedAt: import("convex/values").VFloat64<number | undefined, "optional">;
kind: import("convex/values").VLiteral<"function" | undefined, "optional">;
functionType: import("convex/values").VUnion<"mutation" | "query" | "action", NoInfer<[import("convex/values").VLiteral<"query", "required">, import("convex/values").VLiteral<"mutation", "required">, import("convex/values").VLiteral<"action", "required">]>, "required", never>;
handle: import("convex/values").VString<string, "required">;
workId: import("convex/values").VString<import("@convex-dev/workpool").WorkId | undefined, "optional">;
}, "required", "kind" | "name" | "args" | "runResult" | `args.${string}` | "runResult.kind" | "runResult.returnValue" | `runResult.returnValue.${string}` | "runResult.error" | "startedAt" | "completedAt" | "workId" | "functionType" | "handle" | "inProgress" | "argsSize">, import("convex/values").VObject<{
workflowId?: import("convex/values").GenericId<"workflows"> | undefined;
runResult?: {
kind: "success";
returnValue: any;
} | {
kind: "failed";
error: string;
} | {
kind: "canceled";
} | undefined;
completedAt?: number | undefined;
kind: "workflow";
name: string;
args: any;
startedAt: number;
handle: string;
inProgress: boolean;
argsSize: number;
}, {
name: import("convex/values").VString<string, "required">;
inProgress: import("convex/values").VBoolean<boolean, "required">;
argsSize: import(