MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / updateExecution

Function updateExecution

packages/server/src/utils/buildAgentflow.ts:212–239  ·  view source on GitHub ↗
(appDataSource: DataSource, executionId: string, workspaceId: string, data?: Partial<IExecution>)

Source from the content-addressed store, hash-verified

210 * @returns {Promise<void>}
211 */
212const updateExecution = async (appDataSource: DataSource, executionId: string, workspaceId: string, data?: Partial<IExecution>) => {
213 const execution = await appDataSource.getRepository(Execution).findOneBy({
214 id: executionId,
215 workspaceId
216 })
217
218 if (!execution) {
219 throw new Error(`Execution ${executionId} not found`)
220 }
221
222 const updateExecution = new Execution()
223 const bodyExecution: ICommonObject = {}
224 if (data && data.executionData) {
225 bodyExecution.executionData = typeof data.executionData === 'string' ? data.executionData : JSON.stringify(data.executionData)
226 }
227 if (data && data.state) {
228 bodyExecution.state = data.state
229
230 if (data.state === 'STOPPED') {
231 bodyExecution.stoppedDate = new Date()
232 }
233 }
234
235 Object.assign(updateExecution, bodyExecution)
236
237 appDataSource.getRepository(Execution).merge(execution, updateExecution)
238 await appDataSource.getRepository(Execution).save(execution)
239}
240
241export const resolveVariables = async (
242 reactFlowNodeData: INodeData,

Callers 2

executeNodeFunction · 0.70
executeAgentFlowFunction · 0.70

Calls 1

stringifyMethod · 0.80

Tested by

no test coverage detected