Ghost.io Node | No feature_image and custom_template params

It would help if there was a node for:

  • Creating a new post with featured image and defined template.

My use case:

I use “create a new post” method via Ghost node.
There are most of useful params in the list of available params, but 3 of them are not in the list:

  • feature_image (must have);
  • feature_image_alt (optional);
  • custom_template (optional, but preferred).

Any resources to support this?

Are you willing to work on this?

Feature_image is a must-have param, that will be used by me as well as by other users that are going to create integration with Ghost.io, because this param is a main image for a post. Other params are optional but preferred.

Any movement on this? It is pretty critical as OP says with the featured image param, the others would be nice too indeed!

2 Likes

I have the same problem!

I’m creating a flow with ChatGPT and Ghost for auto-posting content and the native integration of N8N with Ghost doesn’t have these parameters present. I had to make an HTTP Request including the parameters, however, it would be easier if it included the Ghost integration.

If you need it, here’s the HTTP Request code, remembering that you need to authenticate first to then use the json:

// Primeiro, obtém a resposta do ChatGPT (conteúdo do artigo)
const response = $json.response.text;

// Remover o markdown JSON, caso esteja presente
const cleanResponse = response.replace(/^```json\s*|```$/g, '');

try {
    // Parse o JSON limpo
    const parsedResponse = JSON.parse(cleanResponse);

    // Verificar se o título está presente
    if (!parsedResponse["titulo"]) {
        throw new Error("Título está ausente. Verifique a resposta.");
    }
    // Verificar se o conteúdo está presente
    if (!parsedResponse["conteudo"]) {
        throw new Error("Conteúdo está ausente. Verifique a resposta.");
    }
    // Verificar se a imagem está presente (utilizando o ambiente n8n para checagem)
    const featureImageUrl = $('Upload imagem no Ghost').first().json.images[0].url;
    if (!featureImageUrl) {
        throw new Error("Imagem está ausente. Verifique a resposta.");
    }

    

    // Criar o JSON para ser enviado ao próximo nó do HTTP Request
    return {
        json: {
            posts: [
                {
                    title: parsedResponse["titulo"],
                    html: parsedResponse["conteudo"],
                    
                    feature_image: featureImageUrl,
                    feature_image_alt: parsedResponse["meta_titulo"],
                    visibility: "public",
                    meta_title: parsedResponse["meta_titulo"],
                    meta_description: parsedResponse["meta_descricao"],
                    featured: true,
                    tags: [
                        {
                            name: "News"
                        }
                    ],
                    status: "published",
                    slug: parsedResponse["titulo"].toLowerCase().replace(/ /g, "-").replace(/[^a-z0-9-]/g, ""),
                    og_image: featureImageUrl,
                    og_title: parsedResponse["meta_titulo"],
                    og_description: parsedResponse["meta_descricao"],
                    twitter_image: featureImageUrl,
                    twitter_title: parsedResponse["meta_titulo"],
                    twitter_description: parsedResponse["meta_descricao"],
                    excerpt: parsedResponse["meta_descricao"]
                }
            ]
        }
    };
} catch (error) {
    return {
        json: {
            error: 'Failed to parse response',
            details: error.message
        }
    };
}

Remembering that the line you need is probably here:

return {
        json: {
            posts: [
                {
                    title: parsedResponse["titulo"],
                    html: parsedResponse["conteudo"],
                    
                    feature_image: featureImageUrl,
                    feature_image_alt: parsedResponse["meta_titulo"],
                    visibility: "public",
                    meta_title: parsedResponse["meta_titulo"],
                    meta_description: parsedResponse["meta_descricao"],
                    featured: true,
                    tags: [
                        {
                            name: "News"
                        }
                    ],
                    status: "published",
                    slug: parsedResponse["titulo"].toLowerCase().replace(/ /g, "-").replace(/[^a-z0-9-]/g, ""),
                    og_image: featureImageUrl,
                    og_title: parsedResponse["meta_titulo"],
                    og_description: parsedResponse["meta_descricao"],
                    twitter_image: featureImageUrl,
                    twitter_title: parsedResponse["meta_titulo"],
                    twitter_description: parsedResponse["meta_descricao"],
                    excerpt: parsedResponse["meta_descricao"]
                }
            ]
        }

I hope this helps!

Note: the variables are in pt-BR because I’m from Brazil!

Any update here? Really need featured_image in the ghost create a post node.

yeah need this as well. Seems like a silly oversite

Please add this to the integration. It’s maddening that it’s not included.