I have a schedule apex class that calls Queueable apex which calls a class that do a callout and then execute batch.

I receive System.AsyncException: Database.executeBatch cannot be called from a batch start, batch execute, or future method.

global class WorkdayGetRequisitionsSch Implements Schedulable, Database.AllowsCallouts{ 
    global void execute(SchedulableContext sc){
        System.enqueueJob(new WorkdayGetRequisitionsQueueable());

public with sharing class WorkdayGetRequisitionsQueueable implements Queueable , Database.AllowsCallouts { 
    public void execute(QueueableContext context) {

HttpRequest req = new HttpRequest();
HTTPResponse res = http.send(req);
Database.executeBatch(new  WorkdayGetRequisitionsBatchJobs(mapStaffingJobs.Values()), 10 );

1 Answer 1


I found the issue. Remove the Database.AllowsCallouts from the schedule class because salesforce will assume a future method is calling another future method although the schedule class is not doing a callout

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .