Complete Execution Output (JSON):
{
"execution_summary": {
"completed_tasks": 4,
"dependencies_detected": false,
"end_time": "2025-08-01T09:22:41.012282",
"execution_mode": "distributed",
"start_time": "2025-08-01T09:21:09.344369",
"total_tasks": 4
},
"final_report": {
"execution_details": {
"actual_result": {
"output": "__OUTPUTS__ {\"workflow_execution\": {\"status\": \"failed\", \"error\": \"name \u0027UNRESOLVED_list_company_folders\u0027 is not defined\", \"completed_at\": \"2025-08-01T09:22:40.912294\"}, \"processing_summary\": {\"companies_processed\": 0, \"successful_extractions\": 0, \"error_details\": \"name \u0027UNRESOLVED_list_company_folders\u0027 is not defined\"}}\n",
"return_code": 0,
"status": "completed",
"stderr": "Error generating final report: name \u0027UNRESOLVED_list_company_folders\u0027 is not defined\n"
},
"duration_seconds": 0.243299,
"end_time": "2025-08-01T09:22:40.987524",
"message_sent": true,
"start_time": "2025-08-01T09:22:40.744225",
"timestamp": "2025-08-01T09:22:40.987524",
"worker_executed": true,
"workers_notified": true
},
"output": "__OUTPUTS__ {\"workflow_execution\": {\"status\": \"failed\", \"error\": \"name \u0027UNRESOLVED_list_company_folders\u0027 is not defined\", \"completed_at\": \"2025-08-01T09:22:40.912294\"}, \"processing_summary\": {\"companies_processed\": 0, \"successful_extractions\": 0, \"error_details\": \"name \u0027UNRESOLVED_list_company_folders\u0027 is not defined\"}}\n",
"processing_summary": {
"companies_processed": 0,
"error_details": "name \u0027UNRESOLVED_list_company_folders\u0027 is not defined",
"successful_extractions": 0
},
"return_code": 0,
"status": "completed",
"stderr": "Error generating final report: name \u0027UNRESOLVED_list_company_folders\u0027 is not defined\n",
"task_id": "final_report",
"workflow_execution": {
"completed_at": "2025-08-01T09:22:40.912294",
"error": "name \u0027UNRESOLVED_list_company_folders\u0027 is not defined",
"status": "failed"
}
},
"init_drive_handler": {
"access_token": "ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207",
"base_url": "https://www.googleapis.com/drive/v3",
"execution_details": {
"actual_result": {
"output": "\ud83d\udd27 GOOGLE DRIVE INITIALIZATION\n==================================================\n\n\ud83d\udccb Configuration:\n Nango Connection ID: 4274993f-c614-4efa-a01e-8d07422f4b09\n Nango Key: 8df3e2de-2...\n\n\n\ud83d\udd10 Testing authentication...\n\u2705 Authentication successful\n\u2705 Drive handler initialized successfully\n\n__OUTPUTS__ {\"access_token\": \"ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\", \"status\": \"success\", \"base_url\": \"https://www.googleapis.com/drive/v3\"}\n",
"return_code": 0,
"status": "completed",
"stderr": ""
},
"duration_seconds": 0.837323,
"end_time": "2025-08-01T09:21:11.045127",
"message_sent": true,
"start_time": "2025-08-01T09:21:10.207804",
"timestamp": "2025-08-01T09:21:11.045127",
"worker_executed": true,
"workers_notified": true
},
"output": "\ud83d\udd27 GOOGLE DRIVE INITIALIZATION\n==================================================\n\n\ud83d\udccb Configuration:\n Nango Connection ID: 4274993f-c614-4efa-a01e-8d07422f4b09\n Nango Key: 8df3e2de-2...\n\n\n\ud83d\udd10 Testing authentication...\n\u2705 Authentication successful\n\u2705 Drive handler initialized successfully\n\n__OUTPUTS__ {\"access_token\": \"ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\", \"status\": \"success\", \"base_url\": \"https://www.googleapis.com/drive/v3\"}\n",
"return_code": 0,
"status": "completed",
"stderr": "",
"task_id": "init_drive_handler"
},
"list_company_folders": {
"access_token": "ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207",
"execution_details": {
"actual_result": {
"output": "\ud83d\udcc1 LISTING COMPANY FOLDERS\n==================================================\n\n\ud83d\udccb Target Folder ID: 149uvfgjb5Wi5E5FXGaLt67W1sr7nDOQQ\n\n\ud83d\udd10 Getting access token...\n\u2705 Access token obtained\n\ud83d\udcc2 Fetching company folders...\n\u2705 Found 10 total companies\n\ud83d\udcca Processing 3 companies (limited for demo)\n 1. COASTCORP (ID: 1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz)\n 2. WIPRO (ID: 1rqLZ5u5h86Ul_DPIpPO84U_ZxucvDQYH)\n 3. GCHOTELS (ID: 1M7n-Zi6Q4s9o1G6UC8VMquK7udrwfLWn)\n\n__OUTPUTS__ {\"folders\": [{\"id\": \"1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\", \"name\": \"COASTCORP\"}, {\"id\": \"1rqLZ5u5h86Ul_DPIpPO84U_ZxucvDQYH\", \"name\": \"WIPRO\"}, {\"id\": \"1M7n-Zi6Q4s9o1G6UC8VMquK7udrwfLWn\", \"name\": \"GCHOTELS\"}], \"total_companies\": 10, \"processing_companies\": 3, \"access_token\": \"ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\", \"status\": \"success\"}\n",
"return_code": 0,
"status": "completed",
"stderr": ""
},
"duration_seconds": 0.911082,
"end_time": "2025-08-01T09:21:11.156341",
"message_sent": true,
"start_time": "2025-08-01T09:21:10.245259",
"timestamp": "2025-08-01T09:21:11.156341",
"worker_executed": true,
"workers_notified": true
},
"folders": [
{
"id": "1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz",
"name": "COASTCORP"
},
{
"id": "1rqLZ5u5h86Ul_DPIpPO84U_ZxucvDQYH",
"name": "WIPRO"
},
{
"id": "1M7n-Zi6Q4s9o1G6UC8VMquK7udrwfLWn",
"name": "GCHOTELS"
}
],
"output": "\ud83d\udcc1 LISTING COMPANY FOLDERS\n==================================================\n\n\ud83d\udccb Target Folder ID: 149uvfgjb5Wi5E5FXGaLt67W1sr7nDOQQ\n\n\ud83d\udd10 Getting access token...\n\u2705 Access token obtained\n\ud83d\udcc2 Fetching company folders...\n\u2705 Found 10 total companies\n\ud83d\udcca Processing 3 companies (limited for demo)\n 1. COASTCORP (ID: 1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz)\n 2. WIPRO (ID: 1rqLZ5u5h86Ul_DPIpPO84U_ZxucvDQYH)\n 3. GCHOTELS (ID: 1M7n-Zi6Q4s9o1G6UC8VMquK7udrwfLWn)\n\n__OUTPUTS__ {\"folders\": [{\"id\": \"1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\", \"name\": \"COASTCORP\"}, {\"id\": \"1rqLZ5u5h86Ul_DPIpPO84U_ZxucvDQYH\", \"name\": \"WIPRO\"}, {\"id\": \"1M7n-Zi6Q4s9o1G6UC8VMquK7udrwfLWn\", \"name\": \"GCHOTELS\"}], \"total_companies\": 10, \"processing_companies\": 3, \"access_token\": \"ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\", \"status\": \"success\"}\n",
"processing_companies": 3,
"return_code": 0,
"status": "completed",
"stderr": "",
"task_id": "list_company_folders",
"total_companies": 10
},
"process_companies_loop": {
"execution_details": {
"actual_result": {
"loop_result": {
"exit_reason": "max_iterations",
"final_state": {
"processed_companies": [
{
"company_id": "1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz",
"company_name": "COASTCORP",
"fy_extractions": [
{
"balance_sheet": {
"assets": {
"current_assets": 311.1164,
"fixed_assets": 154.2079,
"total_assets": 630.2021
},
"equity": {
"shareholders_funds": 259.4506
},
"financial_year": "FY24",
"liabilities": {
"current_liabilities": 244.635,
"total_liabilities": 370.7515
}
},
"company_name": "COASTCORP",
"extraction_timestamp": "2025-08-01T09:22:38.294962",
"files_processed": 1,
"fy_name": "FY24",
"profit_loss": {
"financial_year": "FY24",
"profitability": {
"ebitda": 353.472,
"ebitda_margin": 8.4556,
"net_profit": 45.218
},
"revenue": {
"net_revenue": 4180.314,
"revenue_growth": 26.6873
}
},
"status": "success"
}
],
"total_fy_processed": 1
}
],
"successful_extractions": 1,
"total_extractions": 1
},
"iteration_results": [
{
"iteration": 0,
"tasks": {
"process_current_company": {
"output": "\ud83d\udd0d DEBUG: folder data {\u0027folders\u0027: [{\u0027id\u0027: \u00271yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\u0027, \u0027name\u0027: \u0027COASTCORP\u0027}, {\u0027id\u0027: \u00271rqLZ5u5h86Ul_DPIpPO84U_ZxucvDQYH\u0027, \u0027name\u0027: \u0027WIPRO\u0027}, {\u0027id\u0027: \u00271M7n-Zi6Q4s9o1G6UC8VMquK7udrwfLWn\u0027, \u0027name\u0027: \u0027GCHOTELS\u0027}], \u0027access_token\u0027: \u0027ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\u0027, \u0027total_companies\u0027: 10, \u0027processing_companies\u0027: 3}\n\ud83d\udd0d DEBUG: Loop iteration 0\n\ud83d\udcc1 Folder data status: unknown\n\ud83d\udcca Number of folders found: 3\n\ud83d\udccb Company index: 0\n\ud83d\udd10 DEBUG: Getting fresh access token for file processing...\n\u2705 DEBUG: Fresh access token obtained\n__OUTPUTS__ {\"company_name\": \"COASTCORP\", \"company_id\": \"1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\", \"fy_folders\": [{\"id\": \"1Cl5Tro9vIwzv8sHqxMT8irX82e2u51xA\", \"name\": \"FY24\"}], \"total_fy_folders\": 1, \"company_index\": 0, \"status\": \"success\"}\n__OUTPUTS__ {\"company_name\": \"COASTCORP\", \"company_id\": \"1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\", \"fy_folders\": \"\u003clist\u003e (size: 61 chars)\", \"total_fy_folders\": 1, \"company_index\": 0, \"status\": \"success\"}\n__STATE_UPDATES__ {}\n__OUTPUTS_FILE__ /tmp/loop_context_process_current_company_iter_0_a4f_lpmt/outputs.json\n__STATE_UPDATES_FILE__ /tmp/loop_context_process_current_company_iter_0_a4f_lpmt/state_updates.json\n",
"outputs": {
"company_id": "1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz",
"company_index": 0,
"company_name": "COASTCORP",
"fy_folders": [
{
"id": "1Cl5Tro9vIwzv8sHqxMT8irX82e2u51xA",
"name": "FY24"
}
],
"status": "success",
"total_fy_folders": 1
},
"state_updates": {},
"status": "completed"
},
"process_fy_folders_current_company": {
"output": "\ud83d\udd0d DEBUG: All available inputs: [\u0027folder_id\u0027, \u0027nango_key\u0027, \u0027EXECUTION_ID\u0027, \u0027execution_id\u0027, \u0027gemini_api_key\u0027, \u0027nango_connection_id\u0027, \u0027list_company_folders\u0027, \u0027company_index\u0027, \u0027total_extractions\u0027, \u0027processed_companies\u0027, \u0027successful_extractions\u0027, \u0027company_name\u0027, \u0027company_id\u0027, \u0027fy_folders\u0027, \u0027total_fy_folders\u0027, \u0027status\u0027, \u0027Process Current Company\u0027]\n\ud83d\udd0d DEBUG: Loop state keys: [\u0027total_extractions\u0027, \u0027processed_companies\u0027, \u0027successful_extractions\u0027]\n\ud83d\udd0d DEBUG: Company name: COASTCORP\n\ud83d\udd0d DEBUG: Company ID: 1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\n\ud83d\udd0d DEBUG: FY folders: [{\u0027id\u0027: \u00271Cl5Tro9vIwzv8sHqxMT8irX82e2u51xA\u0027, \u0027name\u0027: \u0027FY24\u0027}]\n\ud83d\udd0d DEBUG: Task status: success\n\ud83d\udd10 DEBUG: Getting fresh access token for file downloads...\n\u2705 DEBUG: Fresh access token obtained for downloads\n\ud83d\udd0d DEBUG: Starting FY processing for COASTCORP\n\ud83d\udd0d DEBUG: FY folders to process: 1\n\ud83d\udd0d DEBUG: Processing FY folder 1/1: FY24\n\ud83d\udd0d DEBUG: Found item: Yearly report (MIME: application/vnd.google-apps.folder)\n\ud83d\udcc1 DEBUG: Searching inside folder: Yearly report\n\ud83d\udcc4 DEBUG: Found 1 items inside Yearly report\n\ud83d\udcca DEBUG: Total files found after folder exploration: 1\n\ud83d\udd0d DEBUG: Checking file: COASTCORP_FY24_Annual_Report.pdf (MIME: application/pdf)\n\u2705 DEBUG: Added PDF file: COASTCORP_FY24_Annual_Report.pdf\n\ud83d\udd0d DEBUG: Found 1 total files, 1 PDF files in FY24\n\ud83d\udd0d DEBUG: Starting file upload for 1 files\n\ud83d\udd0d DEBUG: Processing file: COASTCORP_FY24_Annual_Report.pdf (ID: 1aEvgNUUYFTWbnsHKsTPYUcsTWRUkxLSb)\n\ud83d\udd0d DEBUG: File MIME type: application/pdf\n\ud83d\udd0d DEBUG: Using direct download endpoint\n\ud83d\udd0d DEBUG: Downloading file from: https://www.googleapis.com/drive/v3/files/1aEvgNUUYFTWbnsHKsTPYUcsTWRUkxLSb\n\ud83d\udd0d DEBUG: Download successful, status: 200\n\ud83d\udd0d DEBUG: Downloaded complete file: 9805189 bytes\n\u2705 DEBUG: PDF validation passed for COASTCORP_FY24_Annual_Report.pdf\n\ud83d\udd0d DEBUG: Content size: 9805189 bytes, uploading to Gemini...\n\u2705 DEBUG: File uploaded to Gemini: files/z4zxxtnb2ej5\n\ud83d\udd0d DEBUG: Gemini file state: FileState.ACTIVE\n\ud83d\udd0d DEBUG: Gemini detected MIME: application/pdf\n\u2705 DEBUG: Successfully uploaded 1 files for COASTCORP - FY24\n\ud83d\udd17 DEBUG: Getting Gemini file references...\n\ud83d\udd17 DEBUG: Got reference for: COASTCORP_FY24_Annual_Report.pdf -\u003e files/z4zxxtnb2ej5\n\ud83d\ude80 DEBUG: Ready to process 1 files with Gemini AI\n\u23f3 DEBUG: Waiting for all files to be fully processed by Gemini...\n\ud83d\udd0d DEBUG: Verifying file readiness...\n\ud83d\udcc4 DEBUG: File files/z4zxxtnb2ej5 state: ACTIVE\n\ud83e\udd16 DEBUG: Starting Gemini extraction for Balance Sheet data...\n\ud83e\udd16 DEBUG: Sending Balance Sheet prompt to Gemini...\n\ud83e\udd16 DEBUG: Gemini Balance Sheet response: {\n \"assets\": {\n \"total_assets\": 630.2021,\n \"current_assets\": 311.1164,\n \"fixed_assets\": 154.2079\n },\n \"liabilities\": {\n \"total_liabilities\": 370.7515,\n \"current_liabilities\": 244.635...\n\u2705 DEBUG: Balance Sheet data extracted successfully\n\ud83e\udd16 DEBUG: Starting Gemini extraction for P\u0026L data...\n\ud83e\udd16 DEBUG: Sending P\u0026L prompt to Gemini...\n\ud83e\udd16 DEBUG: Gemini P\u0026L response: {\n \"revenue\": {\n \"net_revenue\": 4180.314,\n \"revenue_growth\": 26.6873\n },\n \"profitability\": {\n \"ebitda\": 353.472,\n \"net_profit\": 45.218,\n \"ebitda_margin\": 8.4556\n },\n \"financial_yea...\n\u2705 DEBUG: P\u0026L data extracted successfully\n\ud83d\udcca DEBUG: Extraction result compiled:\n - Company: COASTCORP\n - FY: FY24\n - Files processed: 1\n - Balance Sheet extracted: True\n - P\u0026L extracted: True\n\u2705 DEBUG: Added extraction result to company_extractions (1 total)\n\ud83d\udd0d DEBUG: Final results for COASTCORP: 1 extractions completed\n\ud83d\udcca DEBUG: Creating Excel workbook for COASTCORP\n\ud83d\udd0d DEBUG: Found sections to export: [\u0027balance_sheet\u0027, \u0027profit_loss\u0027]\n\u2705 DEBUG: Created sheet: balance_sheet with 8 metrics\n\u2705 DEBUG: Created sheet: profit_loss with 7 metrics\n\ud83d\udce4 DEBUG: Uploading COASTCORP_Financial_Analysis.xlsx to Google Drive...\n\ud83d\udd0d DEBUG: nango_key = 8df3e2de-2307-48d3-94bd-ddd3fd6a62ec\n\ud83d\udd0d DEBUG: nango_connection_id = 4274993f-c614-4efa-a01e-8d07422f4b09\n\ud83d\udd0d DEBUG: Request URL = https://auth-dev.assistents.ai/connection/4274993f-c614-4efa-a01e-8d07422f4b09?provider_config_key=google-drive-hq3h\n\ud83d\udd0d DEBUG: Response status code = 200\n\ud83d\udd0d DEBUG: Response text = {\"id\":136,\"connection_id\":\"4274993f-c614-4efa-a01e-8d07422f4b09\",\"provider_config_key\":\"google-drive-hq3h\",\"provider\":\"google-drive\",\"errors\":[],\"end_user\":{\"id\":\"test_unknown\",\"display_name\":\"unknown\",\"email\":\"unknown@example.com\",\"organization\":null},\"metadata\":null,\"connection_config\":{},\"created_at\":\"2025-07-31T12:47:36.613+00:00\",\"updated_at\":\"2025-08-01T08:50:21.389+00:00\",\"last_fetched_at\":\"2025-08-01T09:22:39.293+00:00\",\"credentials\":{\"type\":\"OAUTH2\",\"access_token\":\"ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\",\"expires_at\":\"2025-08-01T09:50:20.389Z\",\"raw\":{\"access_token\":\"ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\",\"expires_in\":3599,\"scope\":\"https://www.googleapis.com/auth/drive.metadata https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive.readonly https://www.googleapis.com/auth/drive.scripts https://www.googleapis.com/auth/drive\",\"token_type\":\"Bearer\",\"refresh_token_expires_in\":532634,\"expires_at\":\"2025-08-01T09:50:20.389Z\"}}}\n\u2705 DEBUG: Successfully uploaded COASTCORP_Financial_Analysis.xlsx\n\ud83d\udccb DEBUG: File ID: 138yElgD4cqrmHjBYCgo6_jMgoVGMV2Cc\n__OUTPUTS__ {\"company_name\": \"COASTCORP\", \"extractions_completed\": 1, \"excel_upload\": {\"filename\": \"COASTCORP_Financial_Analysis.xlsx\", \"file_id\": \"138yElgD4cqrmHjBYCgo6_jMgoVGMV2Cc\", \"status\": \"success\"}, \"status\": \"success\"}\n__STATE_UPDATES__ {\"processed_companies\": [{\"company_name\": \"COASTCORP\", \"company_id\": \"1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\", \"fy_extractions\": [{\"company_name\": \"COASTCORP\", \"fy_name\": \"FY24\", \"files_processed\": 1, \"balance_sheet\": {\"assets\": {\"total_assets\": 630.2021, \"current_assets\": 311.1164, \"fixed_assets\": 154.2079}, \"liabilities\": {\"total_liabilities\": 370.7515, \"current_liabilities\": 244.635}, \"equity\": {\"shareholders_funds\": 259.4506}, \"financial_year\": \"FY24\"}, \"profit_loss\": {\"revenue\": {\"net_revenue\": 4180.314, \"revenue_growth\": 26.6873}, \"profitability\": {\"ebitda\": 353.472, \"net_profit\": 45.218, \"ebitda_margin\": 8.4556}, \"financial_year\": \"FY24\"}, \"extraction_timestamp\": \"2025-08-01T09:22:38.294962\", \"status\": \"success\"}], \"total_fy_processed\": 1}], \"total_extractions\": 1, \"successful_extractions\": 1}\n__OUTPUTS__ {\"company_name\": \"COASTCORP\", \"extractions_completed\": 1, \"excel_upload\": \"\u003cdict\u003e (size: 118 chars)\", \"status\": \"success\"}\n__STATE_UPDATES__ {\"processed_companies\": \"\u003clist\u003e (size: 728 chars)\", \"total_extractions\": 1, \"successful_extractions\": 1}\n__OUTPUTS_FILE__ /tmp/loop_context_process_fy_folders_current_company_iter_0_hgcz3g1q/outputs.json\n__STATE_UPDATES_FILE__ /tmp/loop_context_process_fy_folders_current_company_iter_0_hgcz3g1q/state_updates.json\n",
"outputs": {
"company_name": "COASTCORP",
"excel_upload": {
"file_id": "138yElgD4cqrmHjBYCgo6_jMgoVGMV2Cc",
"filename": "COASTCORP_Financial_Analysis.xlsx",
"status": "success"
},
"extractions_completed": 1,
"status": "success"
},
"state_updates": {
"processed_companies": [
{
"company_id": "1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz",
"company_name": "COASTCORP",
"fy_extractions": [
{
"balance_sheet": {
"assets": {
"current_assets": 311.1164,
"fixed_assets": 154.2079,
"total_assets": 630.2021
},
"equity": {
"shareholders_funds": 259.4506
},
"financial_year": "FY24",
"liabilities": {
"current_liabilities": 244.635,
"total_liabilities": 370.7515
}
},
"company_name": "COASTCORP",
"extraction_timestamp": "2025-08-01T09:22:38.294962",
"files_processed": 1,
"fy_name": "FY24",
"profit_loss": {
"financial_year": "FY24",
"profitability": {
"ebitda": 353.472,
"ebitda_margin": 8.4556,
"net_profit": 45.218
},
"revenue": {
"net_revenue": 4180.314,
"revenue_growth": 26.6873
}
},
"status": "success"
}
],
"total_fy_processed": 1
}
],
"successful_extractions": 1,
"total_extractions": 1
},
"status": "completed"
}
}
}
],
"iterations_completed": 1
},
"output": "Loop completed after 1 iterations",
"status": "completed"
},
"duration_seconds": 89.522262,
"end_time": "2025-08-01T09:22:40.710862",
"message_sent": true,
"start_time": "2025-08-01T09:21:11.188600",
"timestamp": "2025-08-01T09:22:40.710862",
"worker_executed": true,
"workers_notified": true
},
"exit_reason": "max_iterations",
"final_state": {
"processed_companies": [
{
"company_id": "1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz",
"company_name": "COASTCORP",
"fy_extractions": [
{
"balance_sheet": {
"assets": {
"current_assets": 311.1164,
"fixed_assets": 154.2079,
"total_assets": 630.2021
},
"equity": {
"shareholders_funds": 259.4506
},
"financial_year": "FY24",
"liabilities": {
"current_liabilities": 244.635,
"total_liabilities": 370.7515
}
},
"company_name": "COASTCORP",
"extraction_timestamp": "2025-08-01T09:22:38.294962",
"files_processed": 1,
"fy_name": "FY24",
"profit_loss": {
"financial_year": "FY24",
"profitability": {
"ebitda": 353.472,
"ebitda_margin": 8.4556,
"net_profit": 45.218
},
"revenue": {
"net_revenue": 4180.314,
"revenue_growth": 26.6873
}
},
"status": "success"
}
],
"total_fy_processed": 1
}
],
"successful_extractions": 1,
"total_extractions": 1
},
"iterations_completed": 1,
"loop_result": {
"exit_reason": "max_iterations",
"final_state": {
"processed_companies": [
{
"company_id": "1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz",
"company_name": "COASTCORP",
"fy_extractions": [
{
"balance_sheet": {
"assets": {
"current_assets": 311.1164,
"fixed_assets": 154.2079,
"total_assets": 630.2021
},
"equity": {
"shareholders_funds": 259.4506
},
"financial_year": "FY24",
"liabilities": {
"current_liabilities": 244.635,
"total_liabilities": 370.7515
}
},
"company_name": "COASTCORP",
"extraction_timestamp": "2025-08-01T09:22:38.294962",
"files_processed": 1,
"fy_name": "FY24",
"profit_loss": {
"financial_year": "FY24",
"profitability": {
"ebitda": 353.472,
"ebitda_margin": 8.4556,
"net_profit": 45.218
},
"revenue": {
"net_revenue": 4180.314,
"revenue_growth": 26.6873
}
},
"status": "success"
}
],
"total_fy_processed": 1
}
],
"successful_extractions": 1,
"total_extractions": 1
},
"iteration_results": [
{
"iteration": 0,
"tasks": {
"process_current_company": {
"output": "\ud83d\udd0d DEBUG: folder data {\u0027folders\u0027: [{\u0027id\u0027: \u00271yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\u0027, \u0027name\u0027: \u0027COASTCORP\u0027}, {\u0027id\u0027: \u00271rqLZ5u5h86Ul_DPIpPO84U_ZxucvDQYH\u0027, \u0027name\u0027: \u0027WIPRO\u0027}, {\u0027id\u0027: \u00271M7n-Zi6Q4s9o1G6UC8VMquK7udrwfLWn\u0027, \u0027name\u0027: \u0027GCHOTELS\u0027}], \u0027access_token\u0027: \u0027ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\u0027, \u0027total_companies\u0027: 10, \u0027processing_companies\u0027: 3}\n\ud83d\udd0d DEBUG: Loop iteration 0\n\ud83d\udcc1 Folder data status: unknown\n\ud83d\udcca Number of folders found: 3\n\ud83d\udccb Company index: 0\n\ud83d\udd10 DEBUG: Getting fresh access token for file processing...\n\u2705 DEBUG: Fresh access token obtained\n__OUTPUTS__ {\"company_name\": \"COASTCORP\", \"company_id\": \"1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\", \"fy_folders\": [{\"id\": \"1Cl5Tro9vIwzv8sHqxMT8irX82e2u51xA\", \"name\": \"FY24\"}], \"total_fy_folders\": 1, \"company_index\": 0, \"status\": \"success\"}\n__OUTPUTS__ {\"company_name\": \"COASTCORP\", \"company_id\": \"1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\", \"fy_folders\": \"\u003clist\u003e (size: 61 chars)\", \"total_fy_folders\": 1, \"company_index\": 0, \"status\": \"success\"}\n__STATE_UPDATES__ {}\n__OUTPUTS_FILE__ /tmp/loop_context_process_current_company_iter_0_a4f_lpmt/outputs.json\n__STATE_UPDATES_FILE__ /tmp/loop_context_process_current_company_iter_0_a4f_lpmt/state_updates.json\n",
"outputs": {
"company_id": "1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz",
"company_index": 0,
"company_name": "COASTCORP",
"fy_folders": [
{
"id": "1Cl5Tro9vIwzv8sHqxMT8irX82e2u51xA",
"name": "FY24"
}
],
"status": "success",
"total_fy_folders": 1
},
"state_updates": {},
"status": "completed"
},
"process_fy_folders_current_company": {
"output": "\ud83d\udd0d DEBUG: All available inputs: [\u0027folder_id\u0027, \u0027nango_key\u0027, \u0027EXECUTION_ID\u0027, \u0027execution_id\u0027, \u0027gemini_api_key\u0027, \u0027nango_connection_id\u0027, \u0027list_company_folders\u0027, \u0027company_index\u0027, \u0027total_extractions\u0027, \u0027processed_companies\u0027, \u0027successful_extractions\u0027, \u0027company_name\u0027, \u0027company_id\u0027, \u0027fy_folders\u0027, \u0027total_fy_folders\u0027, \u0027status\u0027, \u0027Process Current Company\u0027]\n\ud83d\udd0d DEBUG: Loop state keys: [\u0027total_extractions\u0027, \u0027processed_companies\u0027, \u0027successful_extractions\u0027]\n\ud83d\udd0d DEBUG: Company name: COASTCORP\n\ud83d\udd0d DEBUG: Company ID: 1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\n\ud83d\udd0d DEBUG: FY folders: [{\u0027id\u0027: \u00271Cl5Tro9vIwzv8sHqxMT8irX82e2u51xA\u0027, \u0027name\u0027: \u0027FY24\u0027}]\n\ud83d\udd0d DEBUG: Task status: success\n\ud83d\udd10 DEBUG: Getting fresh access token for file downloads...\n\u2705 DEBUG: Fresh access token obtained for downloads\n\ud83d\udd0d DEBUG: Starting FY processing for COASTCORP\n\ud83d\udd0d DEBUG: FY folders to process: 1\n\ud83d\udd0d DEBUG: Processing FY folder 1/1: FY24\n\ud83d\udd0d DEBUG: Found item: Yearly report (MIME: application/vnd.google-apps.folder)\n\ud83d\udcc1 DEBUG: Searching inside folder: Yearly report\n\ud83d\udcc4 DEBUG: Found 1 items inside Yearly report\n\ud83d\udcca DEBUG: Total files found after folder exploration: 1\n\ud83d\udd0d DEBUG: Checking file: COASTCORP_FY24_Annual_Report.pdf (MIME: application/pdf)\n\u2705 DEBUG: Added PDF file: COASTCORP_FY24_Annual_Report.pdf\n\ud83d\udd0d DEBUG: Found 1 total files, 1 PDF files in FY24\n\ud83d\udd0d DEBUG: Starting file upload for 1 files\n\ud83d\udd0d DEBUG: Processing file: COASTCORP_FY24_Annual_Report.pdf (ID: 1aEvgNUUYFTWbnsHKsTPYUcsTWRUkxLSb)\n\ud83d\udd0d DEBUG: File MIME type: application/pdf\n\ud83d\udd0d DEBUG: Using direct download endpoint\n\ud83d\udd0d DEBUG: Downloading file from: https://www.googleapis.com/drive/v3/files/1aEvgNUUYFTWbnsHKsTPYUcsTWRUkxLSb\n\ud83d\udd0d DEBUG: Download successful, status: 200\n\ud83d\udd0d DEBUG: Downloaded complete file: 9805189 bytes\n\u2705 DEBUG: PDF validation passed for COASTCORP_FY24_Annual_Report.pdf\n\ud83d\udd0d DEBUG: Content size: 9805189 bytes, uploading to Gemini...\n\u2705 DEBUG: File uploaded to Gemini: files/z4zxxtnb2ej5\n\ud83d\udd0d DEBUG: Gemini file state: FileState.ACTIVE\n\ud83d\udd0d DEBUG: Gemini detected MIME: application/pdf\n\u2705 DEBUG: Successfully uploaded 1 files for COASTCORP - FY24\n\ud83d\udd17 DEBUG: Getting Gemini file references...\n\ud83d\udd17 DEBUG: Got reference for: COASTCORP_FY24_Annual_Report.pdf -\u003e files/z4zxxtnb2ej5\n\ud83d\ude80 DEBUG: Ready to process 1 files with Gemini AI\n\u23f3 DEBUG: Waiting for all files to be fully processed by Gemini...\n\ud83d\udd0d DEBUG: Verifying file readiness...\n\ud83d\udcc4 DEBUG: File files/z4zxxtnb2ej5 state: ACTIVE\n\ud83e\udd16 DEBUG: Starting Gemini extraction for Balance Sheet data...\n\ud83e\udd16 DEBUG: Sending Balance Sheet prompt to Gemini...\n\ud83e\udd16 DEBUG: Gemini Balance Sheet response: {\n \"assets\": {\n \"total_assets\": 630.2021,\n \"current_assets\": 311.1164,\n \"fixed_assets\": 154.2079\n },\n \"liabilities\": {\n \"total_liabilities\": 370.7515,\n \"current_liabilities\": 244.635...\n\u2705 DEBUG: Balance Sheet data extracted successfully\n\ud83e\udd16 DEBUG: Starting Gemini extraction for P\u0026L data...\n\ud83e\udd16 DEBUG: Sending P\u0026L prompt to Gemini...\n\ud83e\udd16 DEBUG: Gemini P\u0026L response: {\n \"revenue\": {\n \"net_revenue\": 4180.314,\n \"revenue_growth\": 26.6873\n },\n \"profitability\": {\n \"ebitda\": 353.472,\n \"net_profit\": 45.218,\n \"ebitda_margin\": 8.4556\n },\n \"financial_yea...\n\u2705 DEBUG: P\u0026L data extracted successfully\n\ud83d\udcca DEBUG: Extraction result compiled:\n - Company: COASTCORP\n - FY: FY24\n - Files processed: 1\n - Balance Sheet extracted: True\n - P\u0026L extracted: True\n\u2705 DEBUG: Added extraction result to company_extractions (1 total)\n\ud83d\udd0d DEBUG: Final results for COASTCORP: 1 extractions completed\n\ud83d\udcca DEBUG: Creating Excel workbook for COASTCORP\n\ud83d\udd0d DEBUG: Found sections to export: [\u0027balance_sheet\u0027, \u0027profit_loss\u0027]\n\u2705 DEBUG: Created sheet: balance_sheet with 8 metrics\n\u2705 DEBUG: Created sheet: profit_loss with 7 metrics\n\ud83d\udce4 DEBUG: Uploading COASTCORP_Financial_Analysis.xlsx to Google Drive...\n\ud83d\udd0d DEBUG: nango_key = 8df3e2de-2307-48d3-94bd-ddd3fd6a62ec\n\ud83d\udd0d DEBUG: nango_connection_id = 4274993f-c614-4efa-a01e-8d07422f4b09\n\ud83d\udd0d DEBUG: Request URL = https://auth-dev.assistents.ai/connection/4274993f-c614-4efa-a01e-8d07422f4b09?provider_config_key=google-drive-hq3h\n\ud83d\udd0d DEBUG: Response status code = 200\n\ud83d\udd0d DEBUG: Response text = {\"id\":136,\"connection_id\":\"4274993f-c614-4efa-a01e-8d07422f4b09\",\"provider_config_key\":\"google-drive-hq3h\",\"provider\":\"google-drive\",\"errors\":[],\"end_user\":{\"id\":\"test_unknown\",\"display_name\":\"unknown\",\"email\":\"unknown@example.com\",\"organization\":null},\"metadata\":null,\"connection_config\":{},\"created_at\":\"2025-07-31T12:47:36.613+00:00\",\"updated_at\":\"2025-08-01T08:50:21.389+00:00\",\"last_fetched_at\":\"2025-08-01T09:22:39.293+00:00\",\"credentials\":{\"type\":\"OAUTH2\",\"access_token\":\"ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\",\"expires_at\":\"2025-08-01T09:50:20.389Z\",\"raw\":{\"access_token\":\"ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\",\"expires_in\":3599,\"scope\":\"https://www.googleapis.com/auth/drive.metadata https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive.readonly https://www.googleapis.com/auth/drive.scripts https://www.googleapis.com/auth/drive\",\"token_type\":\"Bearer\",\"refresh_token_expires_in\":532634,\"expires_at\":\"2025-08-01T09:50:20.389Z\"}}}\n\u2705 DEBUG: Successfully uploaded COASTCORP_Financial_Analysis.xlsx\n\ud83d\udccb DEBUG: File ID: 138yElgD4cqrmHjBYCgo6_jMgoVGMV2Cc\n__OUTPUTS__ {\"company_name\": \"COASTCORP\", \"extractions_completed\": 1, \"excel_upload\": {\"filename\": \"COASTCORP_Financial_Analysis.xlsx\", \"file_id\": \"138yElgD4cqrmHjBYCgo6_jMgoVGMV2Cc\", \"status\": \"success\"}, \"status\": \"success\"}\n__STATE_UPDATES__ {\"processed_companies\": [{\"company_name\": \"COASTCORP\", \"company_id\": \"1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\", \"fy_extractions\": [{\"company_name\": \"COASTCORP\", \"fy_name\": \"FY24\", \"files_processed\": 1, \"balance_sheet\": {\"assets\": {\"total_assets\": 630.2021, \"current_assets\": 311.1164, \"fixed_assets\": 154.2079}, \"liabilities\": {\"total_liabilities\": 370.7515, \"current_liabilities\": 244.635}, \"equity\": {\"shareholders_funds\": 259.4506}, \"financial_year\": \"FY24\"}, \"profit_loss\": {\"revenue\": {\"net_revenue\": 4180.314, \"revenue_growth\": 26.6873}, \"profitability\": {\"ebitda\": 353.472, \"net_profit\": 45.218, \"ebitda_margin\": 8.4556}, \"financial_year\": \"FY24\"}, \"extraction_timestamp\": \"2025-08-01T09:22:38.294962\", \"status\": \"success\"}], \"total_fy_processed\": 1}], \"total_extractions\": 1, \"successful_extractions\": 1}\n__OUTPUTS__ {\"company_name\": \"COASTCORP\", \"extractions_completed\": 1, \"excel_upload\": \"\u003cdict\u003e (size: 118 chars)\", \"status\": \"success\"}\n__STATE_UPDATES__ {\"processed_companies\": \"\u003clist\u003e (size: 728 chars)\", \"total_extractions\": 1, \"successful_extractions\": 1}\n__OUTPUTS_FILE__ /tmp/loop_context_process_fy_folders_current_company_iter_0_hgcz3g1q/outputs.json\n__STATE_UPDATES_FILE__ /tmp/loop_context_process_fy_folders_current_company_iter_0_hgcz3g1q/state_updates.json\n",
"outputs": {
"company_name": "COASTCORP",
"excel_upload": {
"file_id": "138yElgD4cqrmHjBYCgo6_jMgoVGMV2Cc",
"filename": "COASTCORP_Financial_Analysis.xlsx",
"status": "success"
},
"extractions_completed": 1,
"status": "success"
},
"state_updates": {
"processed_companies": [
{
"company_id": "1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz",
"company_name": "COASTCORP",
"fy_extractions": [
{
"balance_sheet": {
"assets": {
"current_assets": 311.1164,
"fixed_assets": 154.2079,
"total_assets": 630.2021
},
"equity": {
"shareholders_funds": 259.4506
},
"financial_year": "FY24",
"liabilities": {
"current_liabilities": 244.635,
"total_liabilities": 370.7515
}
},
"company_name": "COASTCORP",
"extraction_timestamp": "2025-08-01T09:22:38.294962",
"files_processed": 1,
"fy_name": "FY24",
"profit_loss": {
"financial_year": "FY24",
"profitability": {
"ebitda": 353.472,
"ebitda_margin": 8.4556,
"net_profit": 45.218
},
"revenue": {
"net_revenue": 4180.314,
"revenue_growth": 26.6873
}
},
"status": "success"
}
],
"total_fy_processed": 1
}
],
"successful_extractions": 1,
"total_extractions": 1
},
"status": "completed"
}
}
}
],
"iterations_completed": 1
},
"output": "Loop completed after 1 iterations",
"return_code": 0,
"status": "completed",
"stderr": "",
"task_id": "process_companies_loop"
},
"status": "SUCCESS",
"task_outputs": {
"final_report": {
"execution_details": {
"actual_result": {
"output": "__OUTPUTS__ {\"workflow_execution\": {\"status\": \"failed\", \"error\": \"name \u0027UNRESOLVED_list_company_folders\u0027 is not defined\", \"completed_at\": \"2025-08-01T09:22:40.912294\"}, \"processing_summary\": {\"companies_processed\": 0, \"successful_extractions\": 0, \"error_details\": \"name \u0027UNRESOLVED_list_company_folders\u0027 is not defined\"}}\n",
"return_code": 0,
"status": "completed",
"stderr": "Error generating final report: name \u0027UNRESOLVED_list_company_folders\u0027 is not defined\n"
},
"duration_seconds": 0.243299,
"end_time": "2025-08-01T09:22:40.987524",
"message_sent": true,
"start_time": "2025-08-01T09:22:40.744225",
"timestamp": "2025-08-01T09:22:40.987524",
"worker_executed": true,
"workers_notified": true
},
"output": "__OUTPUTS__ {\"workflow_execution\": {\"status\": \"failed\", \"error\": \"name \u0027UNRESOLVED_list_company_folders\u0027 is not defined\", \"completed_at\": \"2025-08-01T09:22:40.912294\"}, \"processing_summary\": {\"companies_processed\": 0, \"successful_extractions\": 0, \"error_details\": \"name \u0027UNRESOLVED_list_company_folders\u0027 is not defined\"}}\n",
"processing_summary": {
"companies_processed": 0,
"error_details": "name \u0027UNRESOLVED_list_company_folders\u0027 is not defined",
"successful_extractions": 0
},
"return_code": 0,
"status": "completed",
"stderr": "Error generating final report: name \u0027UNRESOLVED_list_company_folders\u0027 is not defined\n",
"task_id": "final_report",
"workflow_execution": {
"completed_at": "2025-08-01T09:22:40.912294",
"error": "name \u0027UNRESOLVED_list_company_folders\u0027 is not defined",
"status": "failed"
}
},
"init_drive_handler": {
"access_token": "ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207",
"base_url": "https://www.googleapis.com/drive/v3",
"execution_details": {
"actual_result": {
"output": "\ud83d\udd27 GOOGLE DRIVE INITIALIZATION\n==================================================\n\n\ud83d\udccb Configuration:\n Nango Connection ID: 4274993f-c614-4efa-a01e-8d07422f4b09\n Nango Key: 8df3e2de-2...\n\n\n\ud83d\udd10 Testing authentication...\n\u2705 Authentication successful\n\u2705 Drive handler initialized successfully\n\n__OUTPUTS__ {\"access_token\": \"ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\", \"status\": \"success\", \"base_url\": \"https://www.googleapis.com/drive/v3\"}\n",
"return_code": 0,
"status": "completed",
"stderr": ""
},
"duration_seconds": 0.837323,
"end_time": "2025-08-01T09:21:11.045127",
"message_sent": true,
"start_time": "2025-08-01T09:21:10.207804",
"timestamp": "2025-08-01T09:21:11.045127",
"worker_executed": true,
"workers_notified": true
},
"output": "\ud83d\udd27 GOOGLE DRIVE INITIALIZATION\n==================================================\n\n\ud83d\udccb Configuration:\n Nango Connection ID: 4274993f-c614-4efa-a01e-8d07422f4b09\n Nango Key: 8df3e2de-2...\n\n\n\ud83d\udd10 Testing authentication...\n\u2705 Authentication successful\n\u2705 Drive handler initialized successfully\n\n__OUTPUTS__ {\"access_token\": \"ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\", \"status\": \"success\", \"base_url\": \"https://www.googleapis.com/drive/v3\"}\n",
"return_code": 0,
"status": "completed",
"stderr": "",
"task_id": "init_drive_handler"
},
"list_company_folders": {
"access_token": "ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207",
"execution_details": {
"actual_result": {
"output": "\ud83d\udcc1 LISTING COMPANY FOLDERS\n==================================================\n\n\ud83d\udccb Target Folder ID: 149uvfgjb5Wi5E5FXGaLt67W1sr7nDOQQ\n\n\ud83d\udd10 Getting access token...\n\u2705 Access token obtained\n\ud83d\udcc2 Fetching company folders...\n\u2705 Found 10 total companies\n\ud83d\udcca Processing 3 companies (limited for demo)\n 1. COASTCORP (ID: 1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz)\n 2. WIPRO (ID: 1rqLZ5u5h86Ul_DPIpPO84U_ZxucvDQYH)\n 3. GCHOTELS (ID: 1M7n-Zi6Q4s9o1G6UC8VMquK7udrwfLWn)\n\n__OUTPUTS__ {\"folders\": [{\"id\": \"1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\", \"name\": \"COASTCORP\"}, {\"id\": \"1rqLZ5u5h86Ul_DPIpPO84U_ZxucvDQYH\", \"name\": \"WIPRO\"}, {\"id\": \"1M7n-Zi6Q4s9o1G6UC8VMquK7udrwfLWn\", \"name\": \"GCHOTELS\"}], \"total_companies\": 10, \"processing_companies\": 3, \"access_token\": \"ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\", \"status\": \"success\"}\n",
"return_code": 0,
"status": "completed",
"stderr": ""
},
"duration_seconds": 0.911082,
"end_time": "2025-08-01T09:21:11.156341",
"message_sent": true,
"start_time": "2025-08-01T09:21:10.245259",
"timestamp": "2025-08-01T09:21:11.156341",
"worker_executed": true,
"workers_notified": true
},
"folders": [
{
"id": "1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz",
"name": "COASTCORP"
},
{
"id": "1rqLZ5u5h86Ul_DPIpPO84U_ZxucvDQYH",
"name": "WIPRO"
},
{
"id": "1M7n-Zi6Q4s9o1G6UC8VMquK7udrwfLWn",
"name": "GCHOTELS"
}
],
"output": "\ud83d\udcc1 LISTING COMPANY FOLDERS\n==================================================\n\n\ud83d\udccb Target Folder ID: 149uvfgjb5Wi5E5FXGaLt67W1sr7nDOQQ\n\n\ud83d\udd10 Getting access token...\n\u2705 Access token obtained\n\ud83d\udcc2 Fetching company folders...\n\u2705 Found 10 total companies\n\ud83d\udcca Processing 3 companies (limited for demo)\n 1. COASTCORP (ID: 1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz)\n 2. WIPRO (ID: 1rqLZ5u5h86Ul_DPIpPO84U_ZxucvDQYH)\n 3. GCHOTELS (ID: 1M7n-Zi6Q4s9o1G6UC8VMquK7udrwfLWn)\n\n__OUTPUTS__ {\"folders\": [{\"id\": \"1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\", \"name\": \"COASTCORP\"}, {\"id\": \"1rqLZ5u5h86Ul_DPIpPO84U_ZxucvDQYH\", \"name\": \"WIPRO\"}, {\"id\": \"1M7n-Zi6Q4s9o1G6UC8VMquK7udrwfLWn\", \"name\": \"GCHOTELS\"}], \"total_companies\": 10, \"processing_companies\": 3, \"access_token\": \"ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\", \"status\": \"success\"}\n",
"processing_companies": 3,
"return_code": 0,
"status": "completed",
"stderr": "",
"task_id": "list_company_folders",
"total_companies": 10
},
"process_companies_loop": {
"execution_details": {
"actual_result": {
"loop_result": {
"exit_reason": "max_iterations",
"final_state": {
"processed_companies": [
{
"company_id": "1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz",
"company_name": "COASTCORP",
"fy_extractions": [
{
"balance_sheet": {
"assets": {
"current_assets": 311.1164,
"fixed_assets": 154.2079,
"total_assets": 630.2021
},
"equity": {
"shareholders_funds": 259.4506
},
"financial_year": "FY24",
"liabilities": {
"current_liabilities": 244.635,
"total_liabilities": 370.7515
}
},
"company_name": "COASTCORP",
"extraction_timestamp": "2025-08-01T09:22:38.294962",
"files_processed": 1,
"fy_name": "FY24",
"profit_loss": {
"financial_year": "FY24",
"profitability": {
"ebitda": 353.472,
"ebitda_margin": 8.4556,
"net_profit": 45.218
},
"revenue": {
"net_revenue": 4180.314,
"revenue_growth": 26.6873
}
},
"status": "success"
}
],
"total_fy_processed": 1
}
],
"successful_extractions": 1,
"total_extractions": 1
},
"iteration_results": [
{
"iteration": 0,
"tasks": {
"process_current_company": {
"output": "\ud83d\udd0d DEBUG: folder data {\u0027folders\u0027: [{\u0027id\u0027: \u00271yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\u0027, \u0027name\u0027: \u0027COASTCORP\u0027}, {\u0027id\u0027: \u00271rqLZ5u5h86Ul_DPIpPO84U_ZxucvDQYH\u0027, \u0027name\u0027: \u0027WIPRO\u0027}, {\u0027id\u0027: \u00271M7n-Zi6Q4s9o1G6UC8VMquK7udrwfLWn\u0027, \u0027name\u0027: \u0027GCHOTELS\u0027}], \u0027access_token\u0027: \u0027ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\u0027, \u0027total_companies\u0027: 10, \u0027processing_companies\u0027: 3}\n\ud83d\udd0d DEBUG: Loop iteration 0\n\ud83d\udcc1 Folder data status: unknown\n\ud83d\udcca Number of folders found: 3\n\ud83d\udccb Company index: 0\n\ud83d\udd10 DEBUG: Getting fresh access token for file processing...\n\u2705 DEBUG: Fresh access token obtained\n__OUTPUTS__ {\"company_name\": \"COASTCORP\", \"company_id\": \"1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\", \"fy_folders\": [{\"id\": \"1Cl5Tro9vIwzv8sHqxMT8irX82e2u51xA\", \"name\": \"FY24\"}], \"total_fy_folders\": 1, \"company_index\": 0, \"status\": \"success\"}\n__OUTPUTS__ {\"company_name\": \"COASTCORP\", \"company_id\": \"1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\", \"fy_folders\": \"\u003clist\u003e (size: 61 chars)\", \"total_fy_folders\": 1, \"company_index\": 0, \"status\": \"success\"}\n__STATE_UPDATES__ {}\n__OUTPUTS_FILE__ /tmp/loop_context_process_current_company_iter_0_a4f_lpmt/outputs.json\n__STATE_UPDATES_FILE__ /tmp/loop_context_process_current_company_iter_0_a4f_lpmt/state_updates.json\n",
"outputs": {
"company_id": "1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz",
"company_index": 0,
"company_name": "COASTCORP",
"fy_folders": [
{
"id": "1Cl5Tro9vIwzv8sHqxMT8irX82e2u51xA",
"name": "FY24"
}
],
"status": "success",
"total_fy_folders": 1
},
"state_updates": {},
"status": "completed"
},
"process_fy_folders_current_company": {
"output": "\ud83d\udd0d DEBUG: All available inputs: [\u0027folder_id\u0027, \u0027nango_key\u0027, \u0027EXECUTION_ID\u0027, \u0027execution_id\u0027, \u0027gemini_api_key\u0027, \u0027nango_connection_id\u0027, \u0027list_company_folders\u0027, \u0027company_index\u0027, \u0027total_extractions\u0027, \u0027processed_companies\u0027, \u0027successful_extractions\u0027, \u0027company_name\u0027, \u0027company_id\u0027, \u0027fy_folders\u0027, \u0027total_fy_folders\u0027, \u0027status\u0027, \u0027Process Current Company\u0027]\n\ud83d\udd0d DEBUG: Loop state keys: [\u0027total_extractions\u0027, \u0027processed_companies\u0027, \u0027successful_extractions\u0027]\n\ud83d\udd0d DEBUG: Company name: COASTCORP\n\ud83d\udd0d DEBUG: Company ID: 1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\n\ud83d\udd0d DEBUG: FY folders: [{\u0027id\u0027: \u00271Cl5Tro9vIwzv8sHqxMT8irX82e2u51xA\u0027, \u0027name\u0027: \u0027FY24\u0027}]\n\ud83d\udd0d DEBUG: Task status: success\n\ud83d\udd10 DEBUG: Getting fresh access token for file downloads...\n\u2705 DEBUG: Fresh access token obtained for downloads\n\ud83d\udd0d DEBUG: Starting FY processing for COASTCORP\n\ud83d\udd0d DEBUG: FY folders to process: 1\n\ud83d\udd0d DEBUG: Processing FY folder 1/1: FY24\n\ud83d\udd0d DEBUG: Found item: Yearly report (MIME: application/vnd.google-apps.folder)\n\ud83d\udcc1 DEBUG: Searching inside folder: Yearly report\n\ud83d\udcc4 DEBUG: Found 1 items inside Yearly report\n\ud83d\udcca DEBUG: Total files found after folder exploration: 1\n\ud83d\udd0d DEBUG: Checking file: COASTCORP_FY24_Annual_Report.pdf (MIME: application/pdf)\n\u2705 DEBUG: Added PDF file: COASTCORP_FY24_Annual_Report.pdf\n\ud83d\udd0d DEBUG: Found 1 total files, 1 PDF files in FY24\n\ud83d\udd0d DEBUG: Starting file upload for 1 files\n\ud83d\udd0d DEBUG: Processing file: COASTCORP_FY24_Annual_Report.pdf (ID: 1aEvgNUUYFTWbnsHKsTPYUcsTWRUkxLSb)\n\ud83d\udd0d DEBUG: File MIME type: application/pdf\n\ud83d\udd0d DEBUG: Using direct download endpoint\n\ud83d\udd0d DEBUG: Downloading file from: https://www.googleapis.com/drive/v3/files/1aEvgNUUYFTWbnsHKsTPYUcsTWRUkxLSb\n\ud83d\udd0d DEBUG: Download successful, status: 200\n\ud83d\udd0d DEBUG: Downloaded complete file: 9805189 bytes\n\u2705 DEBUG: PDF validation passed for COASTCORP_FY24_Annual_Report.pdf\n\ud83d\udd0d DEBUG: Content size: 9805189 bytes, uploading to Gemini...\n\u2705 DEBUG: File uploaded to Gemini: files/z4zxxtnb2ej5\n\ud83d\udd0d DEBUG: Gemini file state: FileState.ACTIVE\n\ud83d\udd0d DEBUG: Gemini detected MIME: application/pdf\n\u2705 DEBUG: Successfully uploaded 1 files for COASTCORP - FY24\n\ud83d\udd17 DEBUG: Getting Gemini file references...\n\ud83d\udd17 DEBUG: Got reference for: COASTCORP_FY24_Annual_Report.pdf -\u003e files/z4zxxtnb2ej5\n\ud83d\ude80 DEBUG: Ready to process 1 files with Gemini AI\n\u23f3 DEBUG: Waiting for all files to be fully processed by Gemini...\n\ud83d\udd0d DEBUG: Verifying file readiness...\n\ud83d\udcc4 DEBUG: File files/z4zxxtnb2ej5 state: ACTIVE\n\ud83e\udd16 DEBUG: Starting Gemini extraction for Balance Sheet data...\n\ud83e\udd16 DEBUG: Sending Balance Sheet prompt to Gemini...\n\ud83e\udd16 DEBUG: Gemini Balance Sheet response: {\n \"assets\": {\n \"total_assets\": 630.2021,\n \"current_assets\": 311.1164,\n \"fixed_assets\": 154.2079\n },\n \"liabilities\": {\n \"total_liabilities\": 370.7515,\n \"current_liabilities\": 244.635...\n\u2705 DEBUG: Balance Sheet data extracted successfully\n\ud83e\udd16 DEBUG: Starting Gemini extraction for P\u0026L data...\n\ud83e\udd16 DEBUG: Sending P\u0026L prompt to Gemini...\n\ud83e\udd16 DEBUG: Gemini P\u0026L response: {\n \"revenue\": {\n \"net_revenue\": 4180.314,\n \"revenue_growth\": 26.6873\n },\n \"profitability\": {\n \"ebitda\": 353.472,\n \"net_profit\": 45.218,\n \"ebitda_margin\": 8.4556\n },\n \"financial_yea...\n\u2705 DEBUG: P\u0026L data extracted successfully\n\ud83d\udcca DEBUG: Extraction result compiled:\n - Company: COASTCORP\n - FY: FY24\n - Files processed: 1\n - Balance Sheet extracted: True\n - P\u0026L extracted: True\n\u2705 DEBUG: Added extraction result to company_extractions (1 total)\n\ud83d\udd0d DEBUG: Final results for COASTCORP: 1 extractions completed\n\ud83d\udcca DEBUG: Creating Excel workbook for COASTCORP\n\ud83d\udd0d DEBUG: Found sections to export: [\u0027balance_sheet\u0027, \u0027profit_loss\u0027]\n\u2705 DEBUG: Created sheet: balance_sheet with 8 metrics\n\u2705 DEBUG: Created sheet: profit_loss with 7 metrics\n\ud83d\udce4 DEBUG: Uploading COASTCORP_Financial_Analysis.xlsx to Google Drive...\n\ud83d\udd0d DEBUG: nango_key = 8df3e2de-2307-48d3-94bd-ddd3fd6a62ec\n\ud83d\udd0d DEBUG: nango_connection_id = 4274993f-c614-4efa-a01e-8d07422f4b09\n\ud83d\udd0d DEBUG: Request URL = https://auth-dev.assistents.ai/connection/4274993f-c614-4efa-a01e-8d07422f4b09?provider_config_key=google-drive-hq3h\n\ud83d\udd0d DEBUG: Response status code = 200\n\ud83d\udd0d DEBUG: Response text = {\"id\":136,\"connection_id\":\"4274993f-c614-4efa-a01e-8d07422f4b09\",\"provider_config_key\":\"google-drive-hq3h\",\"provider\":\"google-drive\",\"errors\":[],\"end_user\":{\"id\":\"test_unknown\",\"display_name\":\"unknown\",\"email\":\"unknown@example.com\",\"organization\":null},\"metadata\":null,\"connection_config\":{},\"created_at\":\"2025-07-31T12:47:36.613+00:00\",\"updated_at\":\"2025-08-01T08:50:21.389+00:00\",\"last_fetched_at\":\"2025-08-01T09:22:39.293+00:00\",\"credentials\":{\"type\":\"OAUTH2\",\"access_token\":\"ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\",\"expires_at\":\"2025-08-01T09:50:20.389Z\",\"raw\":{\"access_token\":\"ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\",\"expires_in\":3599,\"scope\":\"https://www.googleapis.com/auth/drive.metadata https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive.readonly https://www.googleapis.com/auth/drive.scripts https://www.googleapis.com/auth/drive\",\"token_type\":\"Bearer\",\"refresh_token_expires_in\":532634,\"expires_at\":\"2025-08-01T09:50:20.389Z\"}}}\n\u2705 DEBUG: Successfully uploaded COASTCORP_Financial_Analysis.xlsx\n\ud83d\udccb DEBUG: File ID: 138yElgD4cqrmHjBYCgo6_jMgoVGMV2Cc\n__OUTPUTS__ {\"company_name\": \"COASTCORP\", \"extractions_completed\": 1, \"excel_upload\": {\"filename\": \"COASTCORP_Financial_Analysis.xlsx\", \"file_id\": \"138yElgD4cqrmHjBYCgo6_jMgoVGMV2Cc\", \"status\": \"success\"}, \"status\": \"success\"}\n__STATE_UPDATES__ {\"processed_companies\": [{\"company_name\": \"COASTCORP\", \"company_id\": \"1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\", \"fy_extractions\": [{\"company_name\": \"COASTCORP\", \"fy_name\": \"FY24\", \"files_processed\": 1, \"balance_sheet\": {\"assets\": {\"total_assets\": 630.2021, \"current_assets\": 311.1164, \"fixed_assets\": 154.2079}, \"liabilities\": {\"total_liabilities\": 370.7515, \"current_liabilities\": 244.635}, \"equity\": {\"shareholders_funds\": 259.4506}, \"financial_year\": \"FY24\"}, \"profit_loss\": {\"revenue\": {\"net_revenue\": 4180.314, \"revenue_growth\": 26.6873}, \"profitability\": {\"ebitda\": 353.472, \"net_profit\": 45.218, \"ebitda_margin\": 8.4556}, \"financial_year\": \"FY24\"}, \"extraction_timestamp\": \"2025-08-01T09:22:38.294962\", \"status\": \"success\"}], \"total_fy_processed\": 1}], \"total_extractions\": 1, \"successful_extractions\": 1}\n__OUTPUTS__ {\"company_name\": \"COASTCORP\", \"extractions_completed\": 1, \"excel_upload\": \"\u003cdict\u003e (size: 118 chars)\", \"status\": \"success\"}\n__STATE_UPDATES__ {\"processed_companies\": \"\u003clist\u003e (size: 728 chars)\", \"total_extractions\": 1, \"successful_extractions\": 1}\n__OUTPUTS_FILE__ /tmp/loop_context_process_fy_folders_current_company_iter_0_hgcz3g1q/outputs.json\n__STATE_UPDATES_FILE__ /tmp/loop_context_process_fy_folders_current_company_iter_0_hgcz3g1q/state_updates.json\n",
"outputs": {
"company_name": "COASTCORP",
"excel_upload": {
"file_id": "138yElgD4cqrmHjBYCgo6_jMgoVGMV2Cc",
"filename": "COASTCORP_Financial_Analysis.xlsx",
"status": "success"
},
"extractions_completed": 1,
"status": "success"
},
"state_updates": {
"processed_companies": [
{
"company_id": "1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz",
"company_name": "COASTCORP",
"fy_extractions": [
{
"balance_sheet": {
"assets": {
"current_assets": 311.1164,
"fixed_assets": 154.2079,
"total_assets": 630.2021
},
"equity": {
"shareholders_funds": 259.4506
},
"financial_year": "FY24",
"liabilities": {
"current_liabilities": 244.635,
"total_liabilities": 370.7515
}
},
"company_name": "COASTCORP",
"extraction_timestamp": "2025-08-01T09:22:38.294962",
"files_processed": 1,
"fy_name": "FY24",
"profit_loss": {
"financial_year": "FY24",
"profitability": {
"ebitda": 353.472,
"ebitda_margin": 8.4556,
"net_profit": 45.218
},
"revenue": {
"net_revenue": 4180.314,
"revenue_growth": 26.6873
}
},
"status": "success"
}
],
"total_fy_processed": 1
}
],
"successful_extractions": 1,
"total_extractions": 1
},
"status": "completed"
}
}
}
],
"iterations_completed": 1
},
"output": "Loop completed after 1 iterations",
"status": "completed"
},
"duration_seconds": 89.522262,
"end_time": "2025-08-01T09:22:40.710862",
"message_sent": true,
"start_time": "2025-08-01T09:21:11.188600",
"timestamp": "2025-08-01T09:22:40.710862",
"worker_executed": true,
"workers_notified": true
},
"exit_reason": "max_iterations",
"final_state": {
"processed_companies": [
{
"company_id": "1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz",
"company_name": "COASTCORP",
"fy_extractions": [
{
"balance_sheet": {
"assets": {
"current_assets": 311.1164,
"fixed_assets": 154.2079,
"total_assets": 630.2021
},
"equity": {
"shareholders_funds": 259.4506
},
"financial_year": "FY24",
"liabilities": {
"current_liabilities": 244.635,
"total_liabilities": 370.7515
}
},
"company_name": "COASTCORP",
"extraction_timestamp": "2025-08-01T09:22:38.294962",
"files_processed": 1,
"fy_name": "FY24",
"profit_loss": {
"financial_year": "FY24",
"profitability": {
"ebitda": 353.472,
"ebitda_margin": 8.4556,
"net_profit": 45.218
},
"revenue": {
"net_revenue": 4180.314,
"revenue_growth": 26.6873
}
},
"status": "success"
}
],
"total_fy_processed": 1
}
],
"successful_extractions": 1,
"total_extractions": 1
},
"iterations_completed": 1,
"loop_result": {
"exit_reason": "max_iterations",
"final_state": {
"processed_companies": [
{
"company_id": "1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz",
"company_name": "COASTCORP",
"fy_extractions": [
{
"balance_sheet": {
"assets": {
"current_assets": 311.1164,
"fixed_assets": 154.2079,
"total_assets": 630.2021
},
"equity": {
"shareholders_funds": 259.4506
},
"financial_year": "FY24",
"liabilities": {
"current_liabilities": 244.635,
"total_liabilities": 370.7515
}
},
"company_name": "COASTCORP",
"extraction_timestamp": "2025-08-01T09:22:38.294962",
"files_processed": 1,
"fy_name": "FY24",
"profit_loss": {
"financial_year": "FY24",
"profitability": {
"ebitda": 353.472,
"ebitda_margin": 8.4556,
"net_profit": 45.218
},
"revenue": {
"net_revenue": 4180.314,
"revenue_growth": 26.6873
}
},
"status": "success"
}
],
"total_fy_processed": 1
}
],
"successful_extractions": 1,
"total_extractions": 1
},
"iteration_results": [
{
"iteration": 0,
"tasks": {
"process_current_company": {
"output": "\ud83d\udd0d DEBUG: folder data {\u0027folders\u0027: [{\u0027id\u0027: \u00271yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\u0027, \u0027name\u0027: \u0027COASTCORP\u0027}, {\u0027id\u0027: \u00271rqLZ5u5h86Ul_DPIpPO84U_ZxucvDQYH\u0027, \u0027name\u0027: \u0027WIPRO\u0027}, {\u0027id\u0027: \u00271M7n-Zi6Q4s9o1G6UC8VMquK7udrwfLWn\u0027, \u0027name\u0027: \u0027GCHOTELS\u0027}], \u0027access_token\u0027: \u0027ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\u0027, \u0027total_companies\u0027: 10, \u0027processing_companies\u0027: 3}\n\ud83d\udd0d DEBUG: Loop iteration 0\n\ud83d\udcc1 Folder data status: unknown\n\ud83d\udcca Number of folders found: 3\n\ud83d\udccb Company index: 0\n\ud83d\udd10 DEBUG: Getting fresh access token for file processing...\n\u2705 DEBUG: Fresh access token obtained\n__OUTPUTS__ {\"company_name\": \"COASTCORP\", \"company_id\": \"1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\", \"fy_folders\": [{\"id\": \"1Cl5Tro9vIwzv8sHqxMT8irX82e2u51xA\", \"name\": \"FY24\"}], \"total_fy_folders\": 1, \"company_index\": 0, \"status\": \"success\"}\n__OUTPUTS__ {\"company_name\": \"COASTCORP\", \"company_id\": \"1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\", \"fy_folders\": \"\u003clist\u003e (size: 61 chars)\", \"total_fy_folders\": 1, \"company_index\": 0, \"status\": \"success\"}\n__STATE_UPDATES__ {}\n__OUTPUTS_FILE__ /tmp/loop_context_process_current_company_iter_0_a4f_lpmt/outputs.json\n__STATE_UPDATES_FILE__ /tmp/loop_context_process_current_company_iter_0_a4f_lpmt/state_updates.json\n",
"outputs": {
"company_id": "1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz",
"company_index": 0,
"company_name": "COASTCORP",
"fy_folders": [
{
"id": "1Cl5Tro9vIwzv8sHqxMT8irX82e2u51xA",
"name": "FY24"
}
],
"status": "success",
"total_fy_folders": 1
},
"state_updates": {},
"status": "completed"
},
"process_fy_folders_current_company": {
"output": "\ud83d\udd0d DEBUG: All available inputs: [\u0027folder_id\u0027, \u0027nango_key\u0027, \u0027EXECUTION_ID\u0027, \u0027execution_id\u0027, \u0027gemini_api_key\u0027, \u0027nango_connection_id\u0027, \u0027list_company_folders\u0027, \u0027company_index\u0027, \u0027total_extractions\u0027, \u0027processed_companies\u0027, \u0027successful_extractions\u0027, \u0027company_name\u0027, \u0027company_id\u0027, \u0027fy_folders\u0027, \u0027total_fy_folders\u0027, \u0027status\u0027, \u0027Process Current Company\u0027]\n\ud83d\udd0d DEBUG: Loop state keys: [\u0027total_extractions\u0027, \u0027processed_companies\u0027, \u0027successful_extractions\u0027]\n\ud83d\udd0d DEBUG: Company name: COASTCORP\n\ud83d\udd0d DEBUG: Company ID: 1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\n\ud83d\udd0d DEBUG: FY folders: [{\u0027id\u0027: \u00271Cl5Tro9vIwzv8sHqxMT8irX82e2u51xA\u0027, \u0027name\u0027: \u0027FY24\u0027}]\n\ud83d\udd0d DEBUG: Task status: success\n\ud83d\udd10 DEBUG: Getting fresh access token for file downloads...\n\u2705 DEBUG: Fresh access token obtained for downloads\n\ud83d\udd0d DEBUG: Starting FY processing for COASTCORP\n\ud83d\udd0d DEBUG: FY folders to process: 1\n\ud83d\udd0d DEBUG: Processing FY folder 1/1: FY24\n\ud83d\udd0d DEBUG: Found item: Yearly report (MIME: application/vnd.google-apps.folder)\n\ud83d\udcc1 DEBUG: Searching inside folder: Yearly report\n\ud83d\udcc4 DEBUG: Found 1 items inside Yearly report\n\ud83d\udcca DEBUG: Total files found after folder exploration: 1\n\ud83d\udd0d DEBUG: Checking file: COASTCORP_FY24_Annual_Report.pdf (MIME: application/pdf)\n\u2705 DEBUG: Added PDF file: COASTCORP_FY24_Annual_Report.pdf\n\ud83d\udd0d DEBUG: Found 1 total files, 1 PDF files in FY24\n\ud83d\udd0d DEBUG: Starting file upload for 1 files\n\ud83d\udd0d DEBUG: Processing file: COASTCORP_FY24_Annual_Report.pdf (ID: 1aEvgNUUYFTWbnsHKsTPYUcsTWRUkxLSb)\n\ud83d\udd0d DEBUG: File MIME type: application/pdf\n\ud83d\udd0d DEBUG: Using direct download endpoint\n\ud83d\udd0d DEBUG: Downloading file from: https://www.googleapis.com/drive/v3/files/1aEvgNUUYFTWbnsHKsTPYUcsTWRUkxLSb\n\ud83d\udd0d DEBUG: Download successful, status: 200\n\ud83d\udd0d DEBUG: Downloaded complete file: 9805189 bytes\n\u2705 DEBUG: PDF validation passed for COASTCORP_FY24_Annual_Report.pdf\n\ud83d\udd0d DEBUG: Content size: 9805189 bytes, uploading to Gemini...\n\u2705 DEBUG: File uploaded to Gemini: files/z4zxxtnb2ej5\n\ud83d\udd0d DEBUG: Gemini file state: FileState.ACTIVE\n\ud83d\udd0d DEBUG: Gemini detected MIME: application/pdf\n\u2705 DEBUG: Successfully uploaded 1 files for COASTCORP - FY24\n\ud83d\udd17 DEBUG: Getting Gemini file references...\n\ud83d\udd17 DEBUG: Got reference for: COASTCORP_FY24_Annual_Report.pdf -\u003e files/z4zxxtnb2ej5\n\ud83d\ude80 DEBUG: Ready to process 1 files with Gemini AI\n\u23f3 DEBUG: Waiting for all files to be fully processed by Gemini...\n\ud83d\udd0d DEBUG: Verifying file readiness...\n\ud83d\udcc4 DEBUG: File files/z4zxxtnb2ej5 state: ACTIVE\n\ud83e\udd16 DEBUG: Starting Gemini extraction for Balance Sheet data...\n\ud83e\udd16 DEBUG: Sending Balance Sheet prompt to Gemini...\n\ud83e\udd16 DEBUG: Gemini Balance Sheet response: {\n \"assets\": {\n \"total_assets\": 630.2021,\n \"current_assets\": 311.1164,\n \"fixed_assets\": 154.2079\n },\n \"liabilities\": {\n \"total_liabilities\": 370.7515,\n \"current_liabilities\": 244.635...\n\u2705 DEBUG: Balance Sheet data extracted successfully\n\ud83e\udd16 DEBUG: Starting Gemini extraction for P\u0026L data...\n\ud83e\udd16 DEBUG: Sending P\u0026L prompt to Gemini...\n\ud83e\udd16 DEBUG: Gemini P\u0026L response: {\n \"revenue\": {\n \"net_revenue\": 4180.314,\n \"revenue_growth\": 26.6873\n },\n \"profitability\": {\n \"ebitda\": 353.472,\n \"net_profit\": 45.218,\n \"ebitda_margin\": 8.4556\n },\n \"financial_yea...\n\u2705 DEBUG: P\u0026L data extracted successfully\n\ud83d\udcca DEBUG: Extraction result compiled:\n - Company: COASTCORP\n - FY: FY24\n - Files processed: 1\n - Balance Sheet extracted: True\n - P\u0026L extracted: True\n\u2705 DEBUG: Added extraction result to company_extractions (1 total)\n\ud83d\udd0d DEBUG: Final results for COASTCORP: 1 extractions completed\n\ud83d\udcca DEBUG: Creating Excel workbook for COASTCORP\n\ud83d\udd0d DEBUG: Found sections to export: [\u0027balance_sheet\u0027, \u0027profit_loss\u0027]\n\u2705 DEBUG: Created sheet: balance_sheet with 8 metrics\n\u2705 DEBUG: Created sheet: profit_loss with 7 metrics\n\ud83d\udce4 DEBUG: Uploading COASTCORP_Financial_Analysis.xlsx to Google Drive...\n\ud83d\udd0d DEBUG: nango_key = 8df3e2de-2307-48d3-94bd-ddd3fd6a62ec\n\ud83d\udd0d DEBUG: nango_connection_id = 4274993f-c614-4efa-a01e-8d07422f4b09\n\ud83d\udd0d DEBUG: Request URL = https://auth-dev.assistents.ai/connection/4274993f-c614-4efa-a01e-8d07422f4b09?provider_config_key=google-drive-hq3h\n\ud83d\udd0d DEBUG: Response status code = 200\n\ud83d\udd0d DEBUG: Response text = {\"id\":136,\"connection_id\":\"4274993f-c614-4efa-a01e-8d07422f4b09\",\"provider_config_key\":\"google-drive-hq3h\",\"provider\":\"google-drive\",\"errors\":[],\"end_user\":{\"id\":\"test_unknown\",\"display_name\":\"unknown\",\"email\":\"unknown@example.com\",\"organization\":null},\"metadata\":null,\"connection_config\":{},\"created_at\":\"2025-07-31T12:47:36.613+00:00\",\"updated_at\":\"2025-08-01T08:50:21.389+00:00\",\"last_fetched_at\":\"2025-08-01T09:22:39.293+00:00\",\"credentials\":{\"type\":\"OAUTH2\",\"access_token\":\"ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\",\"expires_at\":\"2025-08-01T09:50:20.389Z\",\"raw\":{\"access_token\":\"ya29.A0AS3H6NxjP7fiMhVqTFZnxeb8N1cypzfpSgmsbYBxZkZwA5AZK9bZaP1XOgcBQx0AHhxebNLA6JAf6jM-4n9Fyf2eTDmnk_YbGJB1rpYsj0MmonjtcTd9r2sti__G-uyR2bWDWIrK32iLgNkQbbATaNYOm_v_nmY4oLO40Q_5_ubKOsOXtpsbz6XglVr6yOz3FavkgOe7aCgYKAcgSARUSFQHGX2MiMr9T8JNlwPS1ewL6fVIsXQ0207\",\"expires_in\":3599,\"scope\":\"https://www.googleapis.com/auth/drive.metadata https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive.readonly https://www.googleapis.com/auth/drive.scripts https://www.googleapis.com/auth/drive\",\"token_type\":\"Bearer\",\"refresh_token_expires_in\":532634,\"expires_at\":\"2025-08-01T09:50:20.389Z\"}}}\n\u2705 DEBUG: Successfully uploaded COASTCORP_Financial_Analysis.xlsx\n\ud83d\udccb DEBUG: File ID: 138yElgD4cqrmHjBYCgo6_jMgoVGMV2Cc\n__OUTPUTS__ {\"company_name\": \"COASTCORP\", \"extractions_completed\": 1, \"excel_upload\": {\"filename\": \"COASTCORP_Financial_Analysis.xlsx\", \"file_id\": \"138yElgD4cqrmHjBYCgo6_jMgoVGMV2Cc\", \"status\": \"success\"}, \"status\": \"success\"}\n__STATE_UPDATES__ {\"processed_companies\": [{\"company_name\": \"COASTCORP\", \"company_id\": \"1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz\", \"fy_extractions\": [{\"company_name\": \"COASTCORP\", \"fy_name\": \"FY24\", \"files_processed\": 1, \"balance_sheet\": {\"assets\": {\"total_assets\": 630.2021, \"current_assets\": 311.1164, \"fixed_assets\": 154.2079}, \"liabilities\": {\"total_liabilities\": 370.7515, \"current_liabilities\": 244.635}, \"equity\": {\"shareholders_funds\": 259.4506}, \"financial_year\": \"FY24\"}, \"profit_loss\": {\"revenue\": {\"net_revenue\": 4180.314, \"revenue_growth\": 26.6873}, \"profitability\": {\"ebitda\": 353.472, \"net_profit\": 45.218, \"ebitda_margin\": 8.4556}, \"financial_year\": \"FY24\"}, \"extraction_timestamp\": \"2025-08-01T09:22:38.294962\", \"status\": \"success\"}], \"total_fy_processed\": 1}], \"total_extractions\": 1, \"successful_extractions\": 1}\n__OUTPUTS__ {\"company_name\": \"COASTCORP\", \"extractions_completed\": 1, \"excel_upload\": \"\u003cdict\u003e (size: 118 chars)\", \"status\": \"success\"}\n__STATE_UPDATES__ {\"processed_companies\": \"\u003clist\u003e (size: 728 chars)\", \"total_extractions\": 1, \"successful_extractions\": 1}\n__OUTPUTS_FILE__ /tmp/loop_context_process_fy_folders_current_company_iter_0_hgcz3g1q/outputs.json\n__STATE_UPDATES_FILE__ /tmp/loop_context_process_fy_folders_current_company_iter_0_hgcz3g1q/state_updates.json\n",
"outputs": {
"company_name": "COASTCORP",
"excel_upload": {
"file_id": "138yElgD4cqrmHjBYCgo6_jMgoVGMV2Cc",
"filename": "COASTCORP_Financial_Analysis.xlsx",
"status": "success"
},
"extractions_completed": 1,
"status": "success"
},
"state_updates": {
"processed_companies": [
{
"company_id": "1yPAfHhMoDcpQEh11bQ-evXN4UN20-mrz",
"company_name": "COASTCORP",
"fy_extractions": [
{
"balance_sheet": {
"assets": {
"current_assets": 311.1164,
"fixed_assets": 154.2079,
"total_assets": 630.2021
},
"equity": {
"shareholders_funds": 259.4506
},
"financial_year": "FY24",
"liabilities": {
"current_liabilities": 244.635,
"total_liabilities": 370.7515
}
},
"company_name": "COASTCORP",
"extraction_timestamp": "2025-08-01T09:22:38.294962",
"files_processed": 1,
"fy_name": "FY24",
"profit_loss": {
"financial_year": "FY24",
"profitability": {
"ebitda": 353.472,
"ebitda_margin": 8.4556,
"net_profit": 45.218
},
"revenue": {
"net_revenue": 4180.314,
"revenue_growth": 26.6873
}
},
"status": "success"
}
],
"total_fy_processed": 1
}
],
"successful_extractions": 1,
"total_extractions": 1
},
"status": "completed"
}
}
}
],
"iterations_completed": 1
},
"output": "Loop completed after 1 iterations",
"return_code": 0,
"status": "completed",
"stderr": "",
"task_id": "process_companies_loop"
}
}
}