Workflow 'Retool Email' attachment error

I have a workflow in Retool that has been working well for months. However I’ve just started getting this error on the ‘Retool Email’:

“Use File Input component to upload a file and ensure file is uploaded before query is fired.”

Here is how my attachment looks:

Both the ‘generateInvoicePDF’ and ‘prepareInvoiceDetails’ are two prior steps in the workflow that seem to complete successfully.

What could be the issue here?

Thanks, Jake

OK my bad, on further inspection I can see there is any issue in the ‘generateInvoicePDF’ - so that looks to be it.

Thanks

1 Like

Hey @Jake_Slack.

For what is worth, I also realized that I was getting the same error if I didn't add the sizeBytes property, so this is what I currently use as structure of the attachment:

{
"base64Data": {{generateDocument.data.response}},
"name": {{generateDocument.data.fileName + ".pdf"}},
"type": "application/pdf",
"sizeBytes": {{ Math.floor((generateDocument.data.response.length * 3) / 4) - (generateDocument.data.response.endsWith('==') ? 2 : generateDocument.data.response.endsWith('=') ? 1 : 0) }}
}
1 Like

Hey @Jake_Slack

Welcome to the Retool community!

It seems like you were able to resolve this based on this comment? Just double checking if you still need any assistance :grinning_face:

Regards,
John | Retool Support

1 Like

Thanks for that input Miguel but for me it does seem a result of previous workflow step the component was reliant on :+1:

Thanks John! I think it’s looking all good now :+1: