We have a a service class where we use as repository/factory for specific external endpoint. One of those endpoint has a method which takes sometime and for that reason we get a timeout exception since we are making a sync call.

We started to use Apex Continuation but we get the following error:

Apex methods for continuation can not be invoked from a non-continuation action.

There is not so much documentation, we think the cause of the error it's because the invocation of the service we have implemented.

@AuraEnabled(continuation=true cacheable=true)
public static Object updateListSubscription(String subscriptionList, String conctactId){

    HttpRequest request = HTTP_InformaticaInterface.UpdateListSubscription(conctactId, subscriptionList);
    Continuation cont = new Continuation(60);
    cont.state = cont.addHttpRequest(request);
    cont.ContinuationMethod = 'updateListSubscriptionCallback';
    return cont;

public static Boolean updateListSubscriptionCallback(List<String> labels, Object state){
    HttpResponse response = Continuation.getResponse(labels[0]);
    return response.getStatusCode() == 200;

how can we use the "UpdateListSubscription" method in the context of a continuation method?

  • So UpdateListSubscription method is called from AUra component's jS right? Commented Jul 8, 2019 at 11:41
  • Yes It's called from the JS Commented Jul 8, 2019 at 12:27
  • I tried your code and was able to do all, witthout any issues Commented Jul 8, 2019 at 13:05

1 Answer 1


LWC import must get Apex method from apexCountinuation but not apex resource.




You must log in to answer this question.

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