Upload Data Source Block

Hi community — hoping someone has run into this and found a fix.

I’ve built an email-triggered workflow that ingests attachments into a data source. The workflow is:

Email Received → JavaScript Function → Upload Data Source Document → Query Data Source → Generate Text → Send Email

The JavaScript function fetches the attachment URL and writes the file content to a workflow variable using ai.vars.file_content. That part works perfectly — the variable is populated with the full document text in the debugger.

The Upload Data Source Document step then receives {{file_content}} in the Document field. In the debugger it shows:

•	File content resolving correctly (2,971 bytes)
•	“Document processing started” with a real document ID
•	“Document processing complete”
•	“Data source is ready for queries”

Everything looks successful. But when I check the data source in the Explorer panel, the document count never changes. The Query Data Source step immediately following also returns no results from the newly uploaded content.

What I’ve tried:

•	Passing {{attachments}} directly — uploads 97 bytes (just the URL string)
•	Passing {{attachments[0]}} — syntax not supported in MindStudio variable fields
•	Using a Set Variable block to extract the URL — array indexing not supported
•	Using a JavaScript function with ai.vars to fetch and set file_content — variable populates correctly but upload doesn’t persist
•	Watching the data source in real time during a workflow run — document count never moves

Has anyone successfully uploaded documents to a data source programmatically via a workflow? Is there something specific about how the Document field needs to be formatted?

Hi @Guest,

Thanks for the post, and apologies for the inconvenience.

Could you share the Debugger logs for that run? To do that, open the Debugger, select the run, click Share, and reply with the URL:

That will let me take a closer look.

Thank you Alex. See below

https://app.mindstudio.ai/share/debugger/cac5b82e-ad6d-48d0-a9fd-75fc7c9c3a17/4c1c116b-daaa-4011-8c27-0381b8dabab8

Hi @Guest,

Thanks for the link, and apologies for the inconvenience.

I’ve flagged the issue to our engineers and will follow up here as soon as I have an update.

In the meantime, the workflow should complete successfully if you send an email to the Draft email address defined in your Start block.

Thank you, Alex. Much appreciated.

HI Alex. The draft one isnt working either. The source docs dont increase in number following an email to the draft or to the published agent. Let me know if you hear back from the team. Appreciate the help!

Hi Alex. Just checking in. Thank you!

Hi @Guest,

Thanks for checking in. Apologies it’s taking longer than expected. Our engineers are still looking into this and I’ll update you here as soon as I have news.

Thank you!!

Hi Alex. Is there a workaround for this? I just want to be able to email on my source docs. Thanks in advance.