An API that connects multiple Microsoft services, enabling data access and automation across platforms
Microsoft Graph PDF conversion timing out at ~45 seconds with "General_Timeout" error
Thomas, Andre (CDC)
20
Reputation points
Environment:
- Azure App Service (Windows)
- Node.js application v18.19.1
-
@microsoft/microsoft-graph-clientv3.0.7 - Testing with Postman (to isolate from client-side issues)
- SharePoint Online drive item conversion
Issue: I'm using the Microsoft Graph API to convert Word documents to PDF via the /drives/{driveId}/items/{itemId}/content?format=pdf endpoint. The conversion consistently times out after approximately 45 seconds with a General_Timeout error, even for a relatively small 7 MB Word document containing only text (no images or complex formatting).
Error Response:
{
"error": {
"code": "generalException",
"message": "The operation has timed out.",
"innererror": {
"code": "General_Timeout"
}
}
}
Code Example
const token = await getAccessToken(); // OAuth2 client credentials flow
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), 600000); // 10 minute timeout
const response = await fetch(
`https://graph.microsoft.com/v1.0/drives/${driveId}/items/${itemId}/content?format=pdf`,
{
method: 'GET',
headers: {
'Authorization': `Bearer ${token}`
},
signal: controller.signal
}
);
clearTimeout(timeoutId);
What I've Tried:
- Increased timeout to 10 minutes (600,000 ms) using
AbortController - Tested with both the Graph SDK client and raw
fetch()- same result - Confirmed the timeout occurs at ~45 seconds consistently across multiple attempts
- Verified the file is accessible (can download without
?format=pdfsuccessfully) - Tested with simple text-only Word documents (no images, 7 MB file size)
Questions:
- Is there a server-side timeout limit (approximately 45 seconds) for the synchronous
?format=pdfconversion that cannot be overridden? - Are there any recommended file size or complexity limits for synchronous PDF conversion? The documentation says 100MB file size limit so I'm well within that.
- Is there an asynchronous/job-based API for document conversion to avoid synchronous timeout limits?
The 100 MB file size limit suggests larger files should be supported, but I'm hitting timeouts well below that threshold. Any guidance would be appreciated.
Microsoft Security | Microsoft Graph
Microsoft Security | Microsoft Graph
Sign in to answer