Slack AI vector workflow help

I am trying to work with the template workflow provided by Retool, which populates my vector with content from my Slack channel.

I seem to be getting this error - and I'm not quite sure what to do.....

*Error evaluating populateVectorWithSlackData: (line 3) TypeError: is not iterable
*--- Failed running query: populateVectorWithSlackData ---
*--- Hit failure ---

The problematic code is this:

const result = []

for (const entry of {
  if (entry.subtype || !entry.thread_ts) {
  const thread = await getThread(entry.thread_ts,
  const messages =
  const first = messages.shift()

  const link = await getLink(first.ts,
  const title =
  const document = [`Q: ${first.text}`, => `Reply: ${m.text}`)].join("\n")
  await addDocumentToVector(title, document)

return result

The three steps before this one seem to be successful. So I am authenticating ok.
Any help that you can give would be appreciated,


Hello @maillme! Do you mind sharing what the fetchSlackData block returned?

thanks for your reply, of course:

However - I think this is incorrect, when I run this separately it is no longer authorising. It was prior to this however :frowning: - so I am not quite sure what has happened here. When I tested this previously - it said success.

Am I picking up the correct token from Slack? I'm slightly confused by which one I shoudl take, but I believe I took an app-level token: