# Generate Document Action Node

**URL:** <https://community.appfarm.io/t/generate-document-action-node/713>\
**Category:** Ask the community\
**Created:** [September 21, 2023, 12:05pm UTC](https://community.appfarm.io/t/generate-document-action-node/713 "2023-09-21T12:05:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinbarthel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/martinbarthel/32/541_2.png) [@martinbarthel](https://community.appfarm.io/u/martinbarthel)\
**Post date:** [September 21, 2023, 12:05pm UTC](https://community.appfarm.io/t/generate-document-action-node/713/1 "2023-09-21T12:05:41Z")

</div>

Hi!  
I am generating PDFs using the “Generate Document” action node. Even though the template string stays the same, the action fails often. The error messages I get are:  
`Access to XMLHttpRequest at 'https://pdf-service.appfarm.io/api/v1/generate' from origin 'https://bevart-dev.appfarm.app' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.`  
And:  
`POST https://pdf-service.appfarm.io/api/v1/generate net::ERR_FAILED 502 (Bad Gateway)'`

The error seems to occur when I am testing multiple times and generally does not happen the first time I generate a PDF after a while.
