Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automaFetch not working #1948

Open
SeanSobey opened this issue Mar 11, 2025 · 4 comments
Open

automaFetch not working #1948

SeanSobey opened this issue Mar 11, 2025 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@SeanSobey
Copy link

SeanSobey commented Mar 11, 2025

I have a server running locally to provide some data to use in a workflow. Since the last update (or 2), this is no longer working.

This runs in a javascript block:

async function main() {
  
  const automaNextBlockOrig = automaNextBlock; // Since framework calls this sync, hack to wait for our async
  automaNextBlock = () => {};
  
  const {
		  legalEntity,
		  address,
		  loanDetails
  } = await automaFetch('json', { url: 'http://localhost:3041/data'});
  
  automaSetVariable('legalEntity', legalEntity);
  automaSetVariable('address', address);
  automaSetVariable('loanDetails', loanDetails);

  automaNextBlock = automaNextBlockOrig;
  automaNextBlock();
}

main();

Note the hack to wait for the async call, maybe this is related to it no longer working?

@bingren-yd bingren-yd self-assigned this Mar 11, 2025
@bingren-yd bingren-yd added the bug Something isn't working label Mar 11, 2025
@bingren-yd
Copy link
Contributor

Could you please let me know which block you used to execute the JavaScript? Was it the JavaScript block? If it’s convenient for you, could you provide a minimal, anonymized workflow that can reproduce the issue? This would help me pinpoint the problem more quickly.

By the way, if you’re using the JavaScript block, there must be an Active Tab block preceding it.

@bingren-yd
Copy link
Contributor

You could try using the Http Request Block to replace the implementation of this part of the JS.

Image

@SeanSobey
Copy link
Author

Thanks for your reply. Here is a minimal version of the workflow:

automaFetch not working.automa.json

I think I have found the issue though. I am using this to build a SalesForce application and the workflow works fine on other sites, and used to on my SalesForce app. But it looks like there is some website code preventing this:

Image

Running in the background won't work because I need to use automaSetVariable. I will try the http request block

@SeanSobey
Copy link
Author

Indeed yes the HTTP request block works, and is faster:

Image

Maybe this bug will still be helpful in finding a workaround for client side preventions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants