CREATE TABLE IF NOT EXISTS mci_flow_execution_trace (
    id BIGINT AUTO_INCREMENT PRIMARY KEY,
    event_id VARCHAR(128) NOT NULL COMMENT '入站事件ID',
    flow_definition_id BIGINT COMMENT '流程定义ID',
    node_type VARCHAR(64) NOT NULL COMMENT '节点类型',
    node_config JSON COMMENT '节点配置快照',
    input TEXT COMMENT '节点输入',
    output TEXT COMMENT '节点输出',
    status TINYINT NOT NULL DEFAULT 1 COMMENT '1成功 2失败',
    duration_ms INT COMMENT '执行耗时毫秒',
    error_msg VARCHAR(512) COMMENT '错误信息',
    create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    KEY idx_event_id (event_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='流程执行轨迹表';
