{ "name": "MicroEarn - Base64 Converter", "nodes": [ { "id": "15e36e9c-8ac4-4307-b2b2-e79c6b51f1fc", "name": "Setup and pricing", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -520, -180 ], "parameters": { "content": "## Base64 Converter with MicroEarn\nConfigure Header Auth in all HTTP nodes: Authorization = Bearer YOUR_APIFY_TOKEN. Restrict credentials to api.apify.com.\n\nPricing: $0.001 per file plus $0.0005 startup at standard memory. Sample cap: $0.05.\n\nSynthetic sample included. Never embed tokens. Review storage retention before uploading files.\n\nAssign credentials to all three HTTP nodes. The workflow waits up to 120 seconds across two API requests. Longer runs require further status polling using the existing run ID.", "width": 440, "height": 520 } }, { "id": "a0b5871a-264d-4daa-86d3-63a050e890f0", "name": "Start conversion", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -40, -160 ], "parameters": { "content": "## Start and validate run\nStart one Actor run and validate its status.", "width": 680, "height": 300, "color": 7 } }, { "id": "38680fc6-c9a5-4154-858a-b4a7556fa719", "name": "Retrieve conversion", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ 920, -160 ], "parameters": { "content": "## Retrieve and validate output\nRead OUTPUT and verify the processing result.", "width": 440, "height": 300, "color": 7 } }, { "id": "2ebb62f5-d425-4ce4-84b8-d75bc5915f75", "name": "When Manually Triggered", "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [ 0, 0 ], "parameters": {} }, { "id": "d2cecba9-89b6-4d0d-b9c6-c070b8bea399", "name": "Run Base64 Converter", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 240, 0 ], "parameters": { "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "method": "POST", "url": "https://api.apify.com/v2/acts/microearn~microearn-base64-converter/runs", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "waitForFinish", "value": "60" }, { "name": "maxTotalChargeUsd", "value": "0.05" }, { "name": "memory", "value": "256" }, { "name": "timeout", "value": "60" } ] }, "sendBody": true, "specifyBody": "json", "jsonBody": "{\"content\": \"AAECA/7/\", \"operation\": \"decode\", \"variant\": \"standard\", \"inputFormat\": \"base64\"}", "options": { "timeout": 90000 } } }, { "id": "b963d2e3-49b9-4b9c-b258-6a352ab78fde", "name": "Check Run", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 720, 0 ], "parameters": { "jsCode": "const run = $input.first().json.data;\nif (!run || run.status !== 'SUCCEEDED' || !run.defaultKeyValueStoreId) throw new Error('Run not completed: ' + (run?.status ?? 'unknown') + '; run ID: ' + (run?.id ?? 'unknown'));\nreturn [{json:{storeId:run.defaultKeyValueStoreId}}];" } }, { "id": "6c3c0803-7df8-4c66-b771-448a42f1f2ad", "name": "Fetch Results", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 960, 0 ], "parameters": { "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "url": "={{ 'https://api.apify.com/v2/key-value-stores/' + $json.storeId + '/records/OUTPUT' }}", "options": { "timeout": 30000 } } }, { "id": "d5bc2a8f-8345-4856-a385-3bf489d4347b", "name": "Verify Output", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 1200, 0 ], "parameters": { "jsCode": "const result = $input.first().json;\nif (result.status !== 'ok' || !(typeof result.output === 'string' && result.decoded_bytes > 0 && /^[a-f0-9]{64}$/.test(result.sha256))) throw new Error('Invalid processing output');\nreturn [{json:result}];" } }, { "id": "73195575-cd05-4374-ba7c-101f4ba9af93", "name": "Wait for Completion", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 480, 0 ], "parameters": { "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "method": "GET", "url": "={{ 'https://api.apify.com/v2/actor-runs/' + $json.data.id }}", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "waitForFinish", "value": "60" } ] }, "options": { "timeout": 90000 } } } ], "connections": { "When Manually Triggered": { "main": [ [ { "node": "Run Base64 Converter", "type": "main", "index": 0 } ] ] }, "Run Base64 Converter": { "main": [ [ { "node": "Wait for Completion", "type": "main", "index": 0 } ] ] }, "Check Run": { "main": [ [ { "node": "Fetch Results", "type": "main", "index": 0 } ] ] }, "Fetch Results": { "main": [ [ { "node": "Verify Output", "type": "main", "index": 0 } ] ] }, "Wait for Completion": { "main": [ [ { "node": "Check Run", "type": "main", "index": 0 } ] ] } }, "active": false, "pinData": {}, "settings": { "executionOrder": "v1" } }