diff --git a/x-pack/plugins/security_solution/docs/siem_migration/img/agent_graph.png b/x-pack/plugins/security_solution/docs/siem_migration/img/agent_graph.png index 5eb3a5c70355f..03329bcd1135e 100644 Binary files a/x-pack/plugins/security_solution/docs/siem_migration/img/agent_graph.png and b/x-pack/plugins/security_solution/docs/siem_migration/img/agent_graph.png differ diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.ts index 4f2d2a74ff611..5e6803fd9b650 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.ts @@ -36,7 +36,11 @@ export function getRuleMigrationAgent({ .addNode('translationSubGraph', translationSubGraph) // Edges .addEdge(START, 'matchPrebuiltRule') - .addConditionalEdges('matchPrebuiltRule', matchedPrebuiltRuleConditional) + .addConditionalEdges( + 'matchPrebuiltRule', + (state: MigrateRuleState) => matchedPrebuiltRuleConditional(state), + { translate: 'translationSubGraph', end: END } + ) .addEdge('translationSubGraph', END); const graph = siemMigrationAgentGraph.compile(); @@ -46,7 +50,7 @@ export function getRuleMigrationAgent({ const matchedPrebuiltRuleConditional = (state: MigrateRuleState) => { if (state.elastic_rule?.prebuilt_rule_id) { - return END; + return 'end'; } - return 'translation'; + return 'translate'; }; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/graph.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/graph.ts index e3fb4810ebab7..f0b4ea8432fc2 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/graph.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/graph.ts @@ -59,7 +59,7 @@ export function getTranslateRuleGraph({ .addEdge('retrieveIntegrations', 'translateRule') .addEdge('translateRule', 'validation') .addEdge('esql_errors', 'validation') - .addConditionalEdges('validation', (state: TranslateRuleState) => validationRouter({ state }), { + .addConditionalEdges('validation', (state: TranslateRuleState) => validationRouter(state), { esql_error: 'esql_errors', end: END, }); @@ -69,7 +69,7 @@ export function getTranslateRuleGraph({ return graph; } -const validationRouter = ({ state }: TranslateRuleState) => { +const validationRouter = (state: TranslateRuleState) => { if ( state.validation_errors.iterations <= MAX_VALIDATION_ITERATIONS && state.translation_result === SiemMigrationRuleTranslationResult.FULL