Functions - Chromeless



Hey there!

I am having a hard time getting functions to run, with chromeless.

Background: I want to generate social media sharing images. As I am using for my backend I thought this might be a good job for Chromeless.

I deployed chromeless to my personal aws account with the serverless config. So far so good.

Now I want that if a user creates a new “post” in my case a new color palette, that the function gets invoked and chromeless taking a screenshot of of a “private” page which is only for generating the images.

However I can not get it working. I tried it with operationAfter hooks, however as they run sync, its quite a bad experience and I am getting a timeout in the logs. (I guess because of cold boot time of lambda)

So I switched to subscriptions. However now, the functions never gets invoked.


    type: subscription
    query: src/thumbnail/newPalette.graphql
        src: src/thumbnail/createThumb.js


subscription {
  Palette(filter: {
    mutation_in: [CREATED, UPDATED]
  }) {
    node {


const { Chromeless } = require('chromeless')
const { fromEvent } = require('graphcool-lib')

async function run (id) {
  const chromeless = new Chromeless({
    remote: {
      endpointUrl: '',
      apiKey: 'xxxxxxxx',
  const screenshot = await chromeless

  await chromeless.end()

export default async event => {
  const { id } =

  console.log('📝 ID:: ', id)
  console.log('📸 Creating screenshot')
  const screenshot = await run(id)

  console.log('📸', screenshot)
  return screenshot

Would be awesome if someone could point me into the right direction