Can you call a webservice from a Platform Event Trigger?

Older question but felt compelled to add an answer, as I was confused by what was presented here so far.

If you are asking "can I make an Apex HTTP Callout from my Apex Platform Event Trigger?" then the answer is NO.

System.CalloutException: Callout from triggers are currently not supported.

Here's John Brock, the product owner for Platform Events, in the Platform Events success community chatter group March 7, 2019:

Longer term we also hope to relax some of the limits and restrictions on Platform Event triggers since they are executed asynchronously -- such as, I would love to be able to do callouts directly from Apex Triggers.

What you can do, and I think the OP alluded to this when mentioning @future, is to call an asynchronous context like @future or Queueable from your trigger, and do the HTTP Callout from that context instead.


Yes, Even I was wondering with the same kind of questions when I first heard about platform event in Salesforce.

But after taking up Platform Event Trailhead Module, All of my doubts got cleared And here are some major takeaway from the same :

  1. Platform events are like other salesforce records(but can't be edited or deleted.)
  2. You can perform only after insert(in triggers).
  3. After you (publisher) create a platform event, consumer(subscriber) can listen to it.

But i don't think that you would make a web service callout after creating a platform event(just ponder over this use case again and you will know that this is not proper use case for platform events, because when you are creating a platform event, your subscribers which are connected to event channel is already polling/listening for this event).

But still, if you are curious to try out, Because platform events are published by inserting the event sObjects, standard API request limits apply. Referencing a link for further help.

Considerations for Publishing and Subscribing to Platform Events with Apex and API


The event driven architecture approach is subscribing to the platform event in the external service instead of calling a external service - but this only works if you are in control of the service you wan't to call