(
appDataSource: DataSource,
agentflowId: string,
agentFlowExecutedData: IAgentflowExecutedData[],
sessionId: string,
workspaceId: string
)
| 182 | * @returns {Promise<Execution>} |
| 183 | */ |
| 184 | const 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 |
no test coverage detected