MCPcopy
hub / github.com/FlowiseAI/Flowise / addExecution

Function addExecution

packages/server/src/utils/buildAgentflow.ts:184–203  ·  view source on GitHub ↗
(
    appDataSource: DataSource,
    agentflowId: string,
    agentFlowExecutedData: IAgentflowExecutedData[],
    sessionId: string,
    workspaceId: string
)

Source from the content-addressed store, hash-verified

182 * @returns {Promise<Execution>}
183 */
184const addExecution = async (
185 appDataSource: DataSource,
186 agentflowId: string,
187 agentFlowExecutedData: IAgentflowExecutedData[],
188 sessionId: string,
189 workspaceId: string
190) => {
191 const newExecution = new Execution()
192 const bodyExecution = {
193 agentflowId,
194 state: 'INPROGRESS',
195 sessionId,
196 workspaceId,
197 executionData: JSON.stringify(agentFlowExecutedData)
198 }
199 Object.assign(newExecution, bodyExecution)
200
201 const execution = appDataSource.getRepository(Execution).create(newExecution)
202 return await appDataSource.getRepository(Execution).save(execution)
203}
204
205/**
206 * Update execution in database

Callers 1

executeAgentFlowFunction · 0.85

Calls 2

stringifyMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected