Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Uploading to s3 via Make stopped working?

Topic Labels: Automations
1066 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Edward1976
6 - Interface Innovator
6 - Interface Innovator

I previously had this automation working but has for some reason stopped working. Although the file name is uploaded, the isn't actually anything in the image file. Process is click on the 'Process PSDs' button and this fires a webhook to make, which then uploads to s3.

Screenshot 2023-02-22 at 12.16.53.png

This is the script that runs on button click:

// ----------------------------------------------------------------------------
// 🚨 STEP 1. 🚨
// Change 'Test' to the name of your table.
let table = base.getTable('Pre Mock Prod (PB)');
// ----------------------------------------------------------------------------

// ----------------------------------------------------------------------------
// 🚨 STEP 2: 🚨
// Change the following url to your Zapier webhook.
// To get a Zapier webhook, click the below link, then choose "Catch Hook" as the trigger event
// https://zapier.com/app/editor?create=true&template__0__selected_api=WebHookAPI
let webhook_url = 'https://hook.eu1.make.com/o2svol1v14x7i3xoezllg390l8decek5'
// ----------------------------------------------------------------------------

let record = await input.recordAsync('Process PSDs', table);
let record_id = record.id;

// ----------------------------------------------------------------------------
// 🚨 STEP 3. 🚨
// Add all the fields you want to send over to Zapier. Follow the format:
// let record_FIELDNAME = record.getCellValue(FIELDNAME);
let record_mockup_id = record.getCellValue('mockup_id');
let record_mockUpFiles = record.getCellValue('mockUpFiles');
// ----------------------------------------------------------------------------


const customFetch = async (
  record,
) => {
  const url = webhook_url;
  console.log("F url:", url);

  const options = {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      record_id: record_id,

// ----------------------------------------------------------------------------
// 🚨 STEP 4. 🚨
// Pass in the fields you want to use in the Zapier Zap
// Format it like --
// record_FIELDNAME: record_FIELDNAME,
      record_mockup_id: record_mockup_id,
      record_mockUpFiles: record_mockUpFiles,
// ----------------------------------------------------------------------------      
    }),
  };

  const response = await remoteFetchAsync(url, options);
  const result = await response.json();
  return result;
};

let result = await customFetch(record);

console.log(result);
output.markdown(`# You have selected ${result}.`);

This is what I have in Make which could be where the issue lies.

Screenshot 2023-02-22 at 12.21.53.png

I've tried all sorts of configurations but I just get the same empty file uploaded to s3.

Screenshot 2023-02-22 at 12.20.38.png

2 Replies 2

Did this workflow used to work? Does the Make scenario show any errors?

If you try it again a few hours later, does it work?

I noticed a couple days ago that the attachment urls that I was getting from scripting in one particular base (not others) were already expired. Then the issue resolved itself by the next day and the system worked correctly with no changes. Could something similar be happening for you?

Hey Kuovonne, no errors at all. And no it's not been working for a few days. I think a better solution is going to be creating an AWS API gateway. I had another related post on this so will reference the entire solution once its sorted.