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
AliaBurdickAliaBurdick 

Flow error - AllOrNone header

We have a flow that has been in use for quite some time which is supposed to create a campaign member for the primary contact role when certain criteria on a related opportunity are met. We have a daily upload from an external system that is updating values on the opportunity, which in turn triggers the workflow rule/launches flow (this is a time-delayed workflow action, so the records are still sitting in the time-based workflow queue even though the scheduled date has passed).

Most of the time this works as expected. Today I started receiving a Flow Error email with the following message:
"An error occurred at element CampaignMemberCreateSignor (FlowRecordCreate).
INSERT --- INSERT FAILED --- ERRORS : (ALL_OR_NONE_OPERATION_ROLLED_BACK) Record rolled back because not all records were valid and the request was using AllOrNone header, " This error is coming in every 15 minutes or so and hasn't stopped for 24 hours.

All the records listed in the error email look like they are valid, so I'm not sure how to debug this. The flow itself is fairly simple - it looks up the opportunity that triggered the flow, looks up the primary contact role, looks for a campaign that matches criteria on the opportunity, looks for an existing campaign member, and then creates a campaign member if no matching member is found. Does anyone have any advice on how to investigate this further and prevent it from happening in the first place? Thank you in advance for any advice/help that's out there!

Here is an example of what I'm getting back in the email for each affected record - each one of them follows the flow correctly until it gets to the last step where the Result is "Failed to create record.". 

Flow Details
Flow Name: CreateRenewalCampaignMemberSignor
Type: Autolaunched Flow
Version: 7
Status: Active
Flow Interview Details
Interview Label: CreateRenewalCampaignMemberSignorv1.2b 2/23/2016 7:13 AM
Current User: DB Amp NF (00580000008bsXi)
Start time: 2/23/2016 7:13 AM
Duration: 0 seconds
How the Interview Started
DB Amp NF (00580000008bsXi) started the flow interview.
Some of this flow's variables were set when the interview started.
inputOpportunityId = 0063400000yS1f5
RECORD QUERY: OpportunityLookUp
Find one Opportunity record where:
StageName Equals {!conStageNameIsFunded} (Funded)
Id Equals {!inputOpportunityId} (0063400000yS1f5)
Result
Successfully found record.
{!varAccountId} = 0013400001KNgJZAA1
{!varOpportunityId} = 0063400000yS1f5AAC
{!varIntRenewalNumber} = 100A
RECORD QUERY: CampaignLookUp
Find one Campaign record where:
Int_Renewal_Email_Campaign_Iteration__c Equals {!varIntRenewalNumber} (100A)
Result
Successfully found record.
{!varCampaignId} = 701800000016AwiAAE
RECORD QUERY: OpportunitySignorLookUp
Find one OpportunityContactRole record where:
Role Equals {!ConSignor} (Signor)
OpportunityId Equals {!varOpportunityId} (0063400000yS1f5AAC)
Result
Successfully found record.
{!varSignorId} = 0033400001oEp3pAAC
RECORD QUERY: CampaignMemberLookup
Find one CampaignMember record where:
CampaignId Equals {!varCampaignId} (701800000016AwiAAE)
ContactId Equals {!varSignorId} (0033400001oEp3pAAC)
Result
Failed to find record.
DECISION: SignorNotInCampaign
Executed this outcome: Signor_Not_In_Campaign
Outcome conditions: and
1. {!varCampaignMemberId} (null) Is null true
Logic: All conditions must be true (AND)
RECORD CREATE: CampaignMemberCreateSignor
Create one CampaignMember record where:
CampaignId = {!varCampaignId} (701800000016AwiAAE)
ContactId = {!varSignorId} (0033400001oEp3pAAC)
Status = {!conSent} (Sent)
Result
Failed to create record.
Parker EdelmannParker Edelmann
Everything looks like it's working correctly until you get to the Record Create Element. Unless you did something wrong in the create element, which I don't think you did, there shouldn't be a problem, unless the Campaign Member record it was trying to create failed to pass validation. To test that, follow the same steps the flow did, and see if the resulting campaign member fails to meet validation. It's just a theory, but it may be the cause of the error. Thank you for reading,

Parker