MCPcopy Index your code
hub / github.com/coder/mux / appendNextEvent

Method appendNextEvent

src/node/services/workflows/WorkflowRunStore.ts:288–308  ·  view source on GitHub ↗
(
    runId: string,
    event: WorkflowRunEventDraft,
    options: AppendWorkflowRunEventOptions = {}
  )

Source from the content-addressed store, hash-verified

286 }
287
288 async appendNextEvent(
289 runId: string,
290 event: WorkflowRunEventDraft,
291 options: AppendWorkflowRunEventOptions = {}
292 ): Promise<WorkflowRunRecord> {
293 assert(runId.length > 0, "WorkflowRunStore.appendNextEvent: runId is required");
294 const eventWithMaybeSequence = event as WorkflowRunEventDraft & { sequence?: unknown };
295 assert(
296 eventWithMaybeSequence.sequence == null,
297 "WorkflowRunStore.appendNextEvent: event sequence is assigned by the store"
298 );
299 return await this.withWorkflowMutationLock(
300 runId,
301 async () =>
302 await this.withExpectedLeaseOwner(
303 runId,
304 options.expectedLeaseOwnerId,
305 async () => await this.appendNextEventUnlocked(runId, event, options)
306 )
307 );
308 }
309
310 async appendEvent(
311 runId: string,

Callers 6

writeWorkflowRunFunction · 0.95
appendStatusMethod · 0.95
appendEventMethod · 0.80

Calls 4

assertFunction · 0.50

Tested by 1

writeWorkflowRunFunction · 0.76