{ "createdAt": "2025-04-07T09:07:55.439Z", "updatedAt": "2025-04-09T06:41:33.000Z", "id": "OkLNJG1HWObUFcS0", "name": "tw_search_do_label", "active": true, "nodes": [ { "parameters": { "operation": "executeQuery", "query": "CALL do_label_news_source({{ JSON.stringify(JSON.stringify($json.news_id))}},{{ JSON.stringify(JSON.stringify($json.label_data)) }},{{ JSON.stringify(JSON.stringify($json.artificial_label_data)) }});", "options": {} }, "id": "3fd1cd68-88f3-4d6f-91e8-a08b6acf2c10", "name": "insert_city_news", "type": "n8n-nodes-base.mySql", "typeVersion": 2.4, "position": [ 740, 480 ], "credentials": { "mySql": { "id": "09oRI0DULmEzD9l8", "name": "SL-DB" } } }, { "parameters": { "jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nresult_data = $input.all();\ncontent_all = {};\nfor(let item_index =0; item_index < result_data.length;item_index++){\n item_data = result_data[item_index].json;\n if('label_data' in item_data){\n content_all['label'] = item_data['label_data'];\n }else if('artificial_label_data' in item_data){\n content_all['artificial_label'] = item_data['artificial_label_data'];\n }\n};\n// console.log(content_all);\ninfo_data_list = JSON.parse($('Webhook').all()[0].json.body.info);\nschedule_id = $('Webhook').all()[0].json.body.schedule_id;\nlabel_data_list = content_all.label;\nartificial_label_data_list = content_all.artificial_label;\nif(artificial_label_data_list.length>0){\n artificial_label_data_list[0]['city_code'] = info_data_list.city_code;\n}\nfunction isEmptyString(value) {\n // 方法1: 直接检查是否为空字符串或null\n if (!value || value.trim() == '' || value.trim() == 'null' || value.trim() == 'None') {\n return true;\n }\n return false;\n};\noutput_all = [];\noutput_all_data_temp = {};\noutput_all_data_temp['news_id'] = info_data_list.id;\noutput_all_data_temp['label_data'] = label_data_list;\noutput_all_data_temp['artificial_label_data'] = artificial_label_data_list;\noutput_all.push(output_all_data_temp);\nconsole.log(JSON.stringify(JSON.stringify(info_data_list.id)));\nconsole.log(JSON.stringify(JSON.stringify(label_data_list)));\nconsole.log(JSON.stringify(JSON.stringify(artificial_label_data_list)));\nreturn output_all;" }, "id": "6436c8a9-c437-47cf-9788-b0a3cee9a010", "name": "get_city_news_sql", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 500, 480 ] }, { "parameters": { "jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\n//answer = \"```json{\\\"test1\\\":\\\"test\\\"}```\";\nfunction isEmptyString(value) {\n // 方法1: 直接检查是否为空字符串或null\n if (!value || value.trim() === '') {\n return true;\n }\n return false;\n};\nfunction isEmpty(value) {\n // 方法1: 直接检查是否为空字符串或null\n if (!value) {\n return true;\n }\n return false;\n};\nlabel_data_list = [];\nartificial_label_data_list = [];\nlabel_data_arr = $input.all();\nlabel_result_list = [];\nartificial_label_result_list = [];\nfor(var label_index=0;label_index", "type": "personal", "projectRelations": [ { "createdAt": "2024-08-23T06:31:21.275Z", "updatedAt": "2024-08-23T06:31:21.275Z", "role": "project:personalOwner", "userId": "3f0021b4-d0a7-4db6-af21-5ef829c47882", "projectId": "C7zKoCDdmGgzUqSW", "user": { "createdAt": "2024-08-23T06:31:16.119Z", "updatedAt": "2025-03-19T06:19:26.514Z", "id": "3f0021b4-d0a7-4db6-af21-5ef829c47882", "email": "zhouwei@ssish.com", "firstName": "周", "lastName": "卫", "personalizationAnswers": { "companyType": "education", "role": "business-owner", "automationBeneficiary": "my-team", "companySize": "20-99", "reportedSource": "friend", "version": "v4", "personalization_survey_submitted_at": "2024-08-23T06:57:52.856Z", "personalization_survey_n8n_version": "1.55.3" }, "settings": { "userActivated": true, "firstSuccessfulWorkflowId": "s6zsznwVs6N4L2Hx", "userActivatedAt": 1725957335278, "npsSurvey": { "responded": true, "lastShownAt": 1742365155724 }, "isOnboarded": true }, "role": "global:owner", "disabled": false, "mfaEnabled": false, "isPending": false, "isOwner": true } } ] } } ], "tags": [] }