I got the following error: Error Occurred During Flow "Send Slack Messages": Apex request count has exceeded limit.
The "Send Slack Messages" flow is a custom flow that simply loops through a collection of an Apex-defined type SlackMessage and sends them using the Send Slack Message action from Flow Core Actions for Slack.
The flow is being called from an Apex queueable, something like this:
public class SlackMessageSenderWithFlow implements SlackMessageSender {
private static final String FLOW_SEND_SLACK_MESSAGE = 'Send_Slack_Messages';
public void send(List<SlackMessage> messages) {
Flow.Interview.createInterview(FLOW_SEND_SLACK_MESSAGE, new Map<String, Object> {
'vc_SlackMessages' => messages
}).start();
}
}
public class AQueueable implements Queueable {
public void execute(QueueableContext ctx) {
// ...
sender.send(messages);
}
}
The error is thrown with just 2 messages, so it's not a callout limit related error.
Is this error due to some kind of limitation of Salesforce flows? The documentation about the Flow.Interview class doesn't state any limitations regarding this situation. I also have not been able to find any information about this error message.
message
by calling theFlow.Interview
start()
once permessage
SlackMessageSenderWithFlow
to send multiple messages (50) from the developer console, and it works perfectly.