$flow) { if (!is_array($flow)) continue; if (empty($flow['enabled'])) continue; $trigger = isset($flow['trigger']) ? (string)$flow['trigger'] : ''; if ($trigger === '' || $trigger !== $eventName) continue; $flow_meta = array_merge($meta, [ 'source' => isset($meta['source']) ? (string)$meta['source'] : 'events.flow', 'event' => $eventName, 'flow_id' => (string)$flow_id, '__mmi_flow_trigger' => true, ]); // Execution logging is handled by Runner when actions execute. MMI_FlowExecutor::run((string)$flow_id, $payload, $flow_meta, [ 'source' => 'events.flow', 'ensure_admin' => true, 'audit' => true, ]); } } }