Is it possible to return a GIF file using $respond?

This topic was automatically generated from Slack. You can find the original thread here.

Garth : This has probably been asked before, but I couldn’t find it. Is it possible to get $respond() to return a .gif from a workflow? I’ve been trying to use a Buffer, but without success:

const TRANSPARENT_GIF_BUFFER = Buffer.from('R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=', 'base64');
$respond({
  status: 200,
  headers: { "Content-Type": "image/gif" },
  body: TRANSPARENT_GIF_BUFFER
});

Giao Phan : That code snippet works perfectly for me, Are you using a http api trigger?

Garth : I had it after a few other async things (e.g. $send.s3). When I moved it to the beginning and added immediate: **true** it started to work. Not sure why that is the case.