Flow Designer - Issue with Executions Tab on Errored Flows Issue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } ProblemWhen a flow fails in the Australia release of ServiceNow, users are no longer able to view execution details to determine the root cause. Failed flow executions display an error message: 'Exception while executing request: Could not deserialize value from sys_flow_value with sys_id [redacted]'. The execution view loads a blank page with a red banner stating: 'There was an error loading the execution details for this flow context'. This behavior is observed in the UAT environment with Flow Designer plugin version 29.5.2, whereas the same issue does not occur in the Yokohama release environment. Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Flow Designer plugin version 29.5.2 Cause<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Root Cause1. The issue is confirmed as part of Problem PRB1989760, titled '[Workflow Studio] Execution details does not load during negative testing', which involves deserialization errors in failed flow executions.2. The error occurs due to compatibility issues in the Australia release with specific data types stored in sys_flow_value, preventing proper execution detail rendering. Resolution Steps to Resolve1. Create a Business Rule on the sys_flow_context table with the following configuration:2. Set the Business Rule to trigger 'After' actions for 'Insert / Update'.3. Add filter conditions to target records where the 'State' changes to 'Complete', 'Error', or 'Cancelled', and the flow is one of the affected flows.4. Add the provided script to the Business Rule to fix serialization issues for ComplexObjectDefinition, ComplexObjectCollectionDefinition, and GRProxyStatic types.5. Test the configuration to ensure failed execution details load correctly.6. As an alternative, upgrade to the Brazil release to resolve the issue permanently. Create a Business Rule on the sys_flow_context table with the following configuration:******************************************************When: AfterActions: Insert / UpdateAdd filter conditions:State changes to Complete OR Error OR CancelledANDFlow is one of the flows affected by this issue (use affected flows sys_ids)As a workaround, add the following script to the Business Rule:****************************************************** (function executeRule(current, previous /* null when async */) { var INLINE_LIMIT = 4000; var CHUNK_SIZE = 4000; var separateReporting = current.getValue('separate_reporting_values'); var isSeparate = separateReporting == 'true' || separateReporting == '1'; var valueTable = isSeparate ? 'sys_flow_report_value' : 'sys_flow_value'; var chunkTable = isSeparate ? 'sys_flow_report_value_chunk' : 'sys_flow_value_chunk'; function readFullValue(gr) { var inlineValue = String( gr.getValue('value') || '' ); var wrapper = JSON.parse(inlineValue); if ( wrapper.storageType !== 'CHUNKED_PLACEHOLDER' ) { return { wrapper: wrapper, inner: wrapper.value, chunked: false }; } var parentSysId = gr.getUniqueValue(); var json = ''; var chunkCount = 0; var expectedPosition = 0; var chunkGR = new GlideRecord(chunkTable); chunkGR.addQuery( 'document_id', parentSysId ); chunkGR.addQuery('field', 'value'); chunkGR.orderBy('position'); chunkGR.query(); while (chunkGR.next()) { var position = parseInt( chunkGR.getValue('position'), 10 ); if (position !== expectedPosition) { throw new Error( 'Non-contiguous chunk positions for ' + valueTable + '/' + parentSysId + ': expected ' + expectedPosition + ', found ' + position ); } var encoded = String( chunkGR.getValue('data') || '' ); if (!encoded) { throw new Error( 'Empty chunk data for ' + valueTable + '/' + parentSysId + ' at position ' + position ); } json += String( GlideCompressionUtil.expandToString( GlideStringUtil .base64DecodeAsBytes(encoded) ) ); chunkCount++; expectedPosition++; } if (chunkCount === 0) { gs.warn( '[FA-FIX] No chunks found for ' + valueTable + '/' + parentSysId + ' (document_id=' + parentSysId + ')' ); return null; } var fullWrapper = JSON.parse(json); return { wrapper: fullWrapper, inner: fullWrapper.value, chunked: true }; } function asSerializedJson(value, label) { if (typeof value === 'string') { try { JSON.parse(value); return value; } catch (e) { gs.warn( '[FA-FIX] Invalid serialized ' + label + ': ' + e ); return null; } } if ( typeof value === 'object' && value !== null ) { return JSON.stringify(value); } gs.warn( '[FA-FIX] Unsupported ' + label + ' value type: ' + typeof value ); return null; } function buildCOProxyFix(inner) { if ( !inner || inner['@typeName'] !== 'ComplexObjectDefinition' ) { return null; } var wrapper = inner.complexObjectWrapper; if (!wrapper) return null; var serialized = asSerializedJson( wrapper.complexObject, 'ComplexObject' ); if (serialized === null) return null; return { '@typeName': 'COProxy', index: 0, co: [serialized], useArray: false, isNativeArray: false }; } function buildCOCollectionProxyFix(inner) { if ( !inner || inner['@typeName'] !== 'ComplexObjectCollectionDefinition' ) { return null; } var wrapper = inner.complexObjectCollectionWrapper; if (!wrapper) return null; var serialized = asSerializedJson( wrapper.complexObjectCollection, 'ComplexObjectCollection' ); if (serialized === null) return null; return { '@typeName': 'COCollectionProxy', index: typeof inner.index === 'number' ? inner.index : -1, co_collection: serialized }; } function buildGRProxyFix(inner) { if ( !inner || inner['@typeName'] !== 'GRProxyStatic' ) { return null; } var table = inner.table || inner.tableName; var ids = inner.sys_id; if (!Array.isArray(ids)) { ids = gs.nil(ids) ? [] : [String(ids)]; } if (gs.nil(table) || ids.length === 0) { gs.warn( '[FA-FIX] Cannot convert ' + 'GRProxyStatic: table or sys_id ' + 'is missing' ); return null; } return { '@typeName': 'GRProxy', table: String(table), sys_id: ids, row: typeof inner.row === 'number' ? inner.row : 0, sort: gs.nil(inner.sort) || inner.sort === 'null' ? null : inner.sort, desc: inner.desc === true || inner.desc === 'true' }; } function buildValueWrapper( originalWrapper, fixedInner, storageType ) { var wrapper = {}; for (var key in originalWrapper) { if ( Object.prototype.hasOwnProperty.call( originalWrapper, key ) && key !== 'value' && key !== 'storageType' && key !== '@valueType' ) { wrapper[key] = originalWrapper[key]; } } wrapper['@valueType'] = 'namedType'; wrapper.value = fixedInner; wrapper.storageType = storageType; return wrapper; } function splitForChunks(value) { var slices = []; var start = 0; while (start < value.length) { var end = Math.min( start + CHUNK_SIZE, value.length ); // Do not split a UTF-16 surrogate pair. if ( end < value.length && value.charCodeAt(end - 1) >= 0xD800 && value.charCodeAt(end - 1) <= 0xDBFF ) { end--; } slices.push( value.substring(start, end) ); start = end; } return slices; } function prepareChunks(json) { var slices = splitForChunks(json); var prepared = []; for ( var i = 0; i < slices.length; i++ ) { var compressed = GlideCompressionUtil.compress( String(slices[i]) ); if (!compressed) { throw new Error( 'Compression returned no data ' + 'for chunk ' + i ); } var encoded = String( GlideStringUtil.base64Encode( compressed ) ); if (!encoded) { throw new Error( 'Base64 encoding returned no ' + 'data for chunk ' + i ); } prepared.push({ position: i, data: encoded, length: encoded.length }); } return prepared; } function deleteChunks(parentSysId) { var chunkGR = new GlideRecord(chunkTable); chunkGR.addQuery( 'document_id', parentSysId ); chunkGR.addQuery('field', 'value'); chunkGR.setWorkflow(false); chunkGR.deleteMultiple(); } function insertChunks( parentSysId, preparedChunks ) { for ( var i = 0; i < preparedChunks.length; i++ ) { var prepared = preparedChunks[i]; var chunkGR = new GlideRecord(chunkTable); chunkGR.initialize(); chunkGR.setWorkflow(false); chunkGR.setValue( 'document_id', parentSysId ); chunkGR.setValue( 'field', 'value' ); chunkGR.setValue( 'position', prepared.position ); chunkGR.setValue( 'length', prepared.length ); chunkGR.setValue( 'data', prepared.data ); var insertedSysId = chunkGR.insert(); if (gs.nil(insertedSysId)) { throw new Error( 'Failed to insert chunk at ' + 'position ' + prepared.position ); } } } function updateParent( gr, value, serializedLength ) { gr.setWorkflow(false); gr.setValue('value', value); gr.setValue( 'length', serializedLength ); var updatedSysId = gr.update(); if (gs.nil(updatedSysId)) { throw new Error( 'Failed to update parent value ' + gr.getUniqueValue() ); } } function writeBack( gr, originalWrapper, fixedInner, wasChunked ) { var inlineWrapper = buildValueWrapper( originalWrapper, fixedInner, 'VALUE' ); var inlineJson = JSON.stringify(inlineWrapper); if (inlineJson.length <= INLINE_LIMIT) { /* * Update the parent first. Once it is inline, * old chunks are no longer used by the reader. */ updateParent( gr, inlineJson, inlineJson.length ); if (wasChunked) deleteChunks( gr.getUniqueValue() ); return 'inline'; } var chunkWrapper = buildValueWrapper( originalWrapper, fixedInner, 'CHUNKED_PLACEHOLDER' ); var chunkJson = JSON.stringify(chunkWrapper); /* * Complete compression and Base64 encoding * before deleting any existing chunks. */ var preparedChunks = prepareChunks(chunkJson); var parentSysId = gr.getUniqueValue(); if (wasChunked) deleteChunks(parentSysId); insertChunks( parentSysId, preparedChunks ); /* * ValueWrapper is polymorphic. The parent * placeholder must include @valueType. */ var placeholder = JSON.stringify({ '@valueType': 'namedType', value: null, storageType: 'CHUNKED_PLACEHOLDER' }); updateParent( gr, placeholder, chunkJson.length ); return 'chunked'; } var gr = new GlideRecord(valueTable); gr.addQuery( 'context', current.getUniqueValue() ); gr.query(); while (gr.next()) { try { var read = readFullValue(gr); if (!read) continue; var fixed = buildCOProxyFix(read.inner) || buildCOCollectionProxyFix( read.inner ) || buildGRProxyFix(read.inner); if (!fixed) continue; var newStorage = writeBack( gr, read.wrapper, fixed, read.chunked ); gs.info( '[FA-FIX] Fixed ' + valueTable + '/' + gr.getUniqueValue() + ' type=' + read.inner['@typeName'] + ' chunked=' + read.chunked + ' newStorage=' + newStorage ); } catch (e) { gs.warn( '[FA-FIX] Error processing ' + gr.getUniqueValue() + ': ' + e ); } } })(current, previous);