MCPcopy Create free account
hub / github.com/effect-app/libs / createActivity

Function createActivity

packages/infra/src/WorkflowEngineSqlite.ts:347–360  ·  view source on GitHub ↗
(
    executionId: string,
    name: string,
    attempt: number,
    encoded: string
  )

Source from the content-addressed store, hash-verified

345 // First-writer-wins persistence of an activity result; returns true if this
346 // call won, false if another writer beat us to the (exec, name, attempt) row.
347 const createActivity = (
348 executionId: string,
349 name: string,
350 attempt: number,
351 encoded: string
352 ): Effect.Effect<boolean> =>
353 exec(
354 `INSERT INTO "${activityTable}" (execution_id, name, attempt, result)
355 VALUES (?, ?, ?, ?)
356 ON CONFLICT DO NOTHING
357 RETURNING execution_id`,
358 [executionId, name, attempt, encoded]
359 )
360 .pipe(Effect.map((rows) => (rows as ReadonlyArray<unknown>).length > 0))
361
362 // Overwrites a previously persisted *suspended* activity result so the next
363 // attempt can record its real outcome.

Callers 1

Calls 3

execFunction · 0.70
pipeMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…