MCPcopy Index your code
hub / github.com/simstudioai/sim / getWorkflowDeploymentVersion

Function getWorkflowDeploymentVersion

apps/sim/lib/workflows/persistence/utils.ts:1243–1275  ·  view source on GitHub ↗
(
  workflowId: string,
  version: number
)

Source from the content-addressed store, hash-verified

1241 * snapshot. Returns null when the version does not exist.
1242 */
1243export async function getWorkflowDeploymentVersion(
1244 workflowId: string,
1245 version: number
1246): Promise<{
1247 id: string
1248 version: number
1249 name: string | null
1250 description: string | null
1251 isActive: boolean
1252 createdAt: Date
1253 state: unknown
1254} | null> {
1255 const [row] = await db
1256 .select({
1257 id: workflowDeploymentVersion.id,
1258 version: workflowDeploymentVersion.version,
1259 name: workflowDeploymentVersion.name,
1260 description: workflowDeploymentVersion.description,
1261 isActive: workflowDeploymentVersion.isActive,
1262 createdAt: workflowDeploymentVersion.createdAt,
1263 state: workflowDeploymentVersion.state,
1264 })
1265 .from(workflowDeploymentVersion)
1266 .where(
1267 and(
1268 eq(workflowDeploymentVersion.workflowId, workflowId),
1269 eq(workflowDeploymentVersion.version, version)
1270 )
1271 )
1272 .limit(1)
1273
1274 return row ?? null
1275}
1276
1277export async function listWorkflowVersions(workflowId: string): Promise<{
1278 versions: Array<{

Callers 2

route.tsFile · 0.90
route.tsFile · 0.90

Calls 1

eqFunction · 0.50

Tested by

no test coverage detected