After quite a bit of fiddling I went with Damian_Ks approach and unzipped on the machine itself.
I’m pretty sure it is unnecessarily complicated but it works quite well now. If anyone spots potential to improve the flow I’d be happy to hear about it! 
{
"name": "Save attachments to Nextcloud",
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
250,
300
],
"alwaysOutputData": true
},
{
"parameters": {
"mailbox": "n8n",
"downloadAttachments": true,
"options": {
"allowUnauthorizedCerts": true
}
},
"name": "IMAP Email",
"type": "n8n-nodes-base.emailReadImap",
"typeVersion": 1,
"position": [
720,
220
],
"alwaysOutputData": false,
"credentials": {
"imap": "[email protected]"
}
},
{
"parameters": {
"command": "=unzip /home/node/n8n/data/{{$workflow.id}}/{{$node[\"IMAP Email\"].binary.attachment_0.fileName}} *.pdf -d /home/node/n8n/data/{{$workflow.id}}/"
},
"name": "Unzip attachment",
"type": "n8n-nodes-base.executeCommand",
"typeVersion": 1,
"position": [
1050,
220
]
},
{
"parameters": {
"fileName": "=/home/node/n8n/data/{{$workflow.id}}/{{$node[\"IMAP Email\"].binary.attachment_0.fileName}}",
"dataPropertyName": "attachment_0"
},
"name": "Save attachment",
"type": "n8n-nodes-base.writeBinaryFile",
"typeVersion": 1,
"position": [
860,
220
]
},
{
"parameters": {
"filePath": "=/home/node/n8n/data/{{$workflow.id}}/{{$node[\"Set zip filename\"].json[\"zipFileName\"]}}/{{$json[\"pdfFileName\"]}}",
"dataPropertyName": "pdf"
},
"name": "Read Binary File",
"type": "n8n-nodes-base.readBinaryFile",
"typeVersion": 1,
"position": [
1500,
470
]
},
{
"parameters": {
"command": "=basename \"$(ls /home/node/n8n/data/{{$workflow.id}}/{{$json[\"zipFileName\"]}}/*.pdf|head -1)\""
},
"name": "Get PDF filename",
"type": "n8n-nodes-base.executeCommand",
"typeVersion": 1,
"position": [
1410,
260
]
},
{
"parameters": {
"path": "=Documents/{{$json[\"pdfFileName\"]}}",
"binaryDataUpload": true,
"binaryPropertyName": "pdf"
},
"name": "Nextcloud",
"type": "n8n-nodes-base.nextCloud",
"typeVersion": 1,
"position": [
1700,
470
],
"credentials": {
"nextCloudApi": "my.nexcloud.xyz"
}
},
{
"parameters": {
"command": "=basename {{$node[\"IMAP Email\"].binary.attachment_0.fileName}} .zip"
},
"name": "Get zip file name without extension",
"type": "n8n-nodes-base.executeCommand",
"typeVersion": 1,
"position": [
1390,
20
]
},
{
"parameters": {
"values": {
"string": [
{
"name": "zipFileName",
"value": "={{$node[\"Get zip file name without extension\"].json[\"stdout\"]}}"
}
]
},
"options": {}
},
"name": "Set zip filename",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
1590,
20
]
},
{
"parameters": {
"values": {
"string": [
{
"name": "pdfFileName",
"value": "={{$node[\"Get PDF filename\"].json[\"stdout\"]}}"
}
]
},
"options": {}
},
"name": "Set PDF filename",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
1600,
270
]
},
{
"parameters": {
"command": "=rm -rf /home/node/n8n/data/{{$workflow.id}}/*"
},
"name": "Execute Command",
"type": "n8n-nodes-base.executeCommand",
"typeVersion": 1,
"position": [
1900,
470
]
}
],
"connections": {
"IMAP Email": {
"main": [
[
{
"node": "Save attachment",
"type": "main",
"index": 0
}
]
]
},
"Save attachment": {
"main": [
[
{
"node": "Unzip attachment",
"type": "main",
"index": 0
}
]
]
},
"Unzip attachment": {
"main": [
[
{
"node": "Get zip file name without extension",
"type": "main",
"index": 0
}
]
]
},
"Get PDF filename": {
"main": [
[
{
"node": "Set PDF filename",
"type": "main",
"index": 0
}
]
]
},
"Read Binary File": {
"main": [
[
{
"node": "Nextcloud",
"type": "main",
"index": 0
}
]
]
},
"Get zip file name without extension": {
"main": [
[
{
"node": "Set zip filename",
"type": "main",
"index": 0
}
]
]
},
"Set zip filename": {
"main": [
[
{
"node": "Get PDF filename",
"type": "main",
"index": 0
}
]
]
},
"Set PDF filename": {
"main": [
[
{
"node": "Read Binary File",
"type": "main",
"index": 0
}
]
]
},
"Nextcloud": {
"main": [
[
{
"node": "Execute Command",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"timezone": "Europe/Berlin",
"executionTimeout": 60
},
"id": "1"
}