function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Angie ShingAngie Shing 

Flow Error: Number of results do not match the number of interviews that have been carried out in a single execution request

Hi, I have a Process Builder job that executes a when a custom object record is created, and certain Critieria are met. (one of the crtieria is a wait 

The PB starts an automated flow to send email.
User-added image
Most of my emails are being sent out as expected.

However, every so often i get a flow error:
Flow Error: Number of results do not match the number of interviews that have been carried out in a single execution request

Below are the details sent in the flow eror email:
Elemento de error emlHTML_Email (FlowActionCall).
El número de resultados no coincide con el número de entrevistas que se han ejecutado en una única solicitud de ejecución masiva.

Detalles del flujo
Nombre de API del flujo: MX_Dealer_Care_Email_Notification
Tipo: Flujo iniciado automáticamente
Versión: 1
Estado: Activo
Org: General Motors Financial Company Inc. (00D20000000p87y)

Detalles de la entrevista del flujo
Etiqueta de entrevista: MX Dealer Care Email Notification 21/07/2020 06:44 PM
Usuario actual: Oscar Diaz (0051I000006Z3gk)
Hora de inicio: 21/07/2020 06:44 PM
Duración: 1 segundos

Cómo se inició la entrevista
Oscar Diaz (0051I000006Z3gk) inició la entrevista de flujo.
Algunas de las variables de este flujo se establecieron cuando se inició la entrevista.
txtCaseRecordID = 5001I00000WhspjQAB
txtOperationId = a1Z1I00000ouQHOUA2

BÚSQUEDA RÁPIDA: recordsDC_Operations
Encontrar todos los registros DC_Operation__c donde:
Id Es igual a {!txtOperationId} (a1Z1I00000ouQHOUA2)
Almacenar esos registros en {!recDCOperation}.
Guardar esos valores de campos en la variable: Id, Case_ID__c, Account_ID__c, Contact_ID__c, DC_Count__c, Detail__c, Motive__c, Area__c, Status__c, Suggestion__c, PDN__c, Case_Number__c, CreatedDate
Resultado
Se encontraron los registros correctamente.

BÚSQUEDA RÁPIDA: recordGetCaseDetails
Encontrar todos los registros Case donde:
Id Es igual a {!txtCaseRecordID} (5001I00000WhspjQAB)
Almacenar los valores de estos campos en recordGetCaseDetails: Id, AccountId, CaseNumber, ContactId, ContactEmail, Subject
Resultado
Se encontraron los registros correctamente.

ASIGNACIÓN: Contact_Details_from_Case
{!txtContactID} Es igual a {!recordGetCaseDetails.Contact.Id}
{!txtEmail} Es igual a {!recordGetCaseDetails.ContactEmail}
{!txtCaseEmailSubject} Es igual a {!recordGetCaseDetails.Subject}
{!txtOpCaseID} Es igual a {!recDCOperation.Case_ID__c}
Resultado
{!txtContactID} = "0031I000019O5OHQA0"
{!txtOpCaseID} = "5001I00000Whspj"
{!txtEmail} = "mocreditogmc3@diezfenix.com (mailto:mocreditogmc3@diezfenix.com" style="color:#0563c1; text-decoration:underline)"
{!txtCaseEmailSubject} = "Lopez - Aprobación de irregulares"

BÚSQUEDA RÁPIDA: recordsContactDetails
Encontrar todos los registros Contact donde:
Id Es igual a {!txtContactID} (0031I000019O5OHQA0)
Almacenar los valores de estos campos en recordsContactDetails: Id, Name
Resultado
Se encontraron los registros correctamente.

ASIGNACIÓN: DC_Operation_Details
{!txtMotivo} Es igual a {!recDCOperation.Motive__c}
{!txtSuggestion} Es igual a {!recDCOperation.Suggestion__c}
{!txtContactName} Es igual a {!recordsContactDetails.Name}
Resultado
{!txtMotivo} = "Aprobación de irregulares"
{!txtContactName} = "Deisy Lopez"
{!txtSuggestion} = "Se confirma irregulares aprobados en respuesta de análisis. Favor de actualizar sistema para corroborar respuesta."

BÚSQUEDA RÁPIDA: recGetEmail_TemplateID
Encontrar todos los registros EmailTemplate donde:
Name Es igual a DC_Template
Almacenar los valores de estos campos en recGetEmail_TemplateID: Id
Resultado
Se encontraron los registros correctamente.

ASIGNACIÓN: Assign_Email_Template
{!varEmailTemplateId} Es igual a {!recGetEmail_TemplateID.Id}
Resultado
{!varEmailTemplateId} = "00X1I0000012vvzUAA"

SENDHTMLEMAIL (APEX): emlHTML_Email
Entradas:
recordId = {!txtOperationId} (a1Z1I00000ouQHOUA2)
replyEmailAddress = {!txtSenderEmail} (norepy@GMFinancial.com (mailto:norepy@GMFinancial.com" style="color:#0563c1; text-decoration:underline))
saveAsActivity = true
SendBCCthisOneEmailAddress = angie.shing@gmfinancial.com (mailto:angie.shing@gmfinancial.com" style="color:#0563c1; text-decoration:underline)
senderDisplayName = Dealer Care Team
SendTOthisOneEmailAddress = {!txtEmail} (mocreditogmc3@diezfenix.com (mailto:mocreditogmc3@diezfenix.com" style="color:#0563c1; text-decoration:underline))
templateTargetObjectId = {!txtContactID} (0031I000019O5OHQA0)
templateID = {!varEmailTemplateId} (00X1I0000012vvzUAA)

Se produjo un error: El número de resultados no coincide con el número de entrevistas que se han ejecutado en una única solicitud de ejecución masiva.


Detalles del flujo
Nombre de API del flujo: MX_Dealer_Care_Email_Notification
Tipo: Flujo iniciado automáticamente
Versión: 1
Estado: Activo
Org: General Motors Financial Company Inc. (00D20000000p87y)

Detalles de la entrevista del flujo
Etiqueta de entrevista: MX Dealer Care Email Notification 21/07/2020 06:44 PM
Usuario actual: Oscar Diaz (0051I000006Z3gk)
Hora de inicio: 21/07/2020 06:44 PM
Duración: 1 segundos

Cómo se inició la entrevista
Oscar Diaz (0051I000006Z3gk) inició la entrevista de flujo.
Algunas de las variables de este flujo se establecieron cuando se inició la entrevista.
txtCaseRecordID = 5001I00000WhspkQAB
txtOperationId = a1Z1I00000ouQHPUA2

BÚSQUEDA RÁPIDA: recordsDC_Operations
Encontrar todos los registros DC_Operation__c donde:
Id Es igual a {!txtOperationId} (a1Z1I00000ouQHPUA2)
Almacenar esos registros en {!recDCOperation}.
Guardar esos valores de campos en la variable: Id, Case_ID__c, Account_ID__c, Contact_ID__c, DC_Count__c, Detail__c, Motive__c, Area__c, Status__c, Suggestion__c, PDN__c, Case_Number__c, CreatedDate
Resultado
Se encontraron los registros correctamente.

BÚSQUEDA RÁPIDA: recordGetCaseDetails
Encontrar todos los registros Case donde:
Id Es igual a {!txtCaseRecordID} (5001I00000WhspkQAB)
Almacenar los valores de estos campos en recordGetCaseDetails: Id, AccountId, CaseNumber, ContactId, ContactEmail, Subject
Resultado
Se encontraron los registros correctamente.

ASIGNACIÓN: Contact_Details_from_Case
{!txtContactID} Es igual a {!recordGetCaseDetails.Contact.Id}
{!txtEmail} Es igual a {!recordGetCaseDetails.ContactEmail}
{!txtCaseEmailSubject} Es igual a {!recordGetCaseDetails.Subject}
{!txtOpCaseID} Es igual a {!recDCOperation.Case_ID__c}
Resultado
{!txtContactID} = "0031I000019OERlQAO"
{!txtOpCaseID} = "5001I00000Whspk"
{!txtEmail} = "financiamientosem@chevrolettoro.com.mx (mailto:financiamientosem@chevrolettoro.com.mx" style="color:#0563c1; text-decoration:underline)"
{!txtCaseEmailSubject} = "Acosta - Estatus de la operación"

BÚSQUEDA RÁPIDA: recordsContactDetails
Encontrar todos los registros Contact donde:
Id Es igual a {!txtContactID} (0031I000019OERlQAO)
Almacenar los valores de estos campos en recordsContactDetails: Id, Name
Resultado
Se encontraron los registros correctamente.

ASIGNACIÓN: DC_Operation_Details
{!txtMotivo} Es igual a {!recDCOperation.Motive__c}
{!txtSuggestion} Es igual a {!recDCOperation.Suggestion__c}
{!txtContactName} Es igual a {!recordsContactDetails.Name}
Resultado
{!txtMotivo} = "Estatus de la operación"
{!txtContactName} = "Fernando Acosta"
{!txtSuggestion} = "La operación se encuentra en flujo compras dentro del SLA. Necesario esperar respuesta en sistema."

BÚSQUEDA RÁPIDA: recGetEmail_TemplateID
Encontrar todos los registros EmailTemplate donde:
Name Es igual a DC_Template
Almacenar los valores de estos campos en recGetEmail_TemplateID: Id
Resultado
Se encontraron los registros correctamente.

ASIGNACIÓN: Assign_Email_Template
{!varEmailTemplateId} Es igual a {!recGetEmail_TemplateID.Id}
Resultado
{!varEmailTemplateId} = "00X1I0000012vvzUAA"

SENDHTMLEMAIL (APEX): emlHTML_Email
Entradas:
recordId = {!txtOperationId} (a1Z1I00000ouQHPUA2)
replyEmailAddress = {!txtSenderEmail} (norepy@GMFinancial.com (mailto:norepy@GMFinancial.com" style="color:#0563c1; text-decoration:underline))
saveAsActivity = true
SendBCCthisOneEmailAddress = angie.shing@gmfinancial.com (mailto:angie.shing@gmfinancial.com" style="color:#0563c1; text-decoration:underline)
senderDisplayName = Dealer Care Team
SendTOthisOneEmailAddress = {!txtEmail} (financiamientosem@chevrolettoro.com.mx (mailto:financiamientosem@chevrolettoro.com.mx" style="color:#0563c1; text-decoration:underline))
templateTargetObjectId = {!txtContactID} (0031I000019OERlQAO)
templateID = {!varEmailTemplateId} (00X1I0000012vvzUAA)

Se produjo un error: El número de resultados no coincide con el número de entrevistas que se han ejecutado en una única solicitud de ejecución masiva.


Id. del error de Salesforce: 404541893-168810 (-1059818582)

It appears to be runing the process twice?
Any thoughts or ideas are appreciated
Thanks in advance!
Angie
ShirishaShirisha (Salesforce Developers) 
Hi Angie,

Greetings!

I would suggest you to add the logic as below to make sure to avoid the errors.

"Check in Flow to check which returned Sobject Collections are empty and which are not. If using this Apex Class to submit 10 records, they will be bulkified to return 1 Collection with 10 records and 9 that have 0 records. The Flow needs all 10 to finish the transaction. Adding a check in Flow to end the Flow if SobjectCollection Count = 0, and continue when Count > 0 has resolved this"

Kindly let me know if it helps you and close your query by marking it as best answer so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
Angie ShingAngie Shing
Hi,
Sorry if i am missing something...
in my PB i am only processing a single email at a time....
I am not sending a collection at all. (Collection to me means multiple records)
When an Operation record is created, after a time delay, i send an email to the contact on the case record the operation record is tied to.

Should i still check for Sobject counts?
Sorry this does not make sense to me.
Angie
Gabriel Bravo 20Gabriel Bravo 20
Hi Angie,
Did you solve that issue?, I'm facing the same problem invoking an Apex Action within a scheduled flow, I'm getting the same message after the Apex call. What was your workaround?

Thanks in advance,
Gabriel Bravo