id: GenericPolling version: -1 name: GenericPolling description: |- Use this playbook as a sub-playbook to block execution of the master playbook until a remote action is complete. This playbook implements polling by continuously running the command in Step \#2 until the operation completes. The remote action should have the following structure: 1. Initiate the operation. 2. Poll to check if the operation completed. 3. (optional) Get the results of the operation. NOTE: This playbook should be run only when the playbook's context is using the "Private to sub-playbook" option. fromversion: 5.0.0 starttaskid: "0" tasks: "0": id: "0" taskid: c644af04-2cd7-4462-83e3-5f55bc12aa73 type: start task: id: c644af04-2cd7-4462-83e3-5f55bc12aa73 version: -1 name: "" description: '-' iscommand: false brand: "" nexttasks: '#none#': - "3" separatecontext: false view: |- { "position": { "x": 50, "y": 50 } } note: false continueonerrortype: "" timertriggers: [] ignoreworker: false skipunavailable: false quietmode: 0 isoversize: false isautoswitchedtoquietmode: false "1": id: "1" taskid: 35c115cc-f926-48db-895a-c10a1dada76e type: regular task: id: 35c115cc-f926-48db-895a-c10a1dada76e version: -1 name: Schedule Polling Task description: Schedule Polling Task scriptName: ScheduleGenericPolling type: regular iscommand: false brand: "" nexttasks: '#none#': - "2" scriptarguments: additionalPollingCommandArgNames: simple: ${inputs.AdditionalPollingCommandArgNames} additionalPollingCommandArgValues: simple: ${inputs.AdditionalPollingCommandArgValues} dt: simple: ${inputs.dt} ids: simple: ${inputs.Ids} interval: simple: ${inputs.Interval} playbookId: simple: ${currentPlaybookID} pollingCommand: simple: ${inputs.PollingCommandName} pollingCommandArgName: simple: ${inputs.PollingCommandArgName} timeout: simple: ${inputs.Timeout} extractMode: simple: ${inputs.ExtractMode} separatecontext: false view: |- { "position": { "x": 50, "y": 370 } } note: false reputationcalc: 1 continueonerrortype: "" timertriggers: [] ignoreworker: false skipunavailable: false quietmode: 0 isoversize: false isautoswitchedtoquietmode: false "2": id: "2" taskid: 154b9a55-3d7c-412e-804c-c838cf7431c0 type: condition task: id: 154b9a55-3d7c-412e-804c-c838cf7431c0 version: -1 name: Waiting for polling to complete (Automated Task) description: This task will complete automatically when polling is complete. tags: - polling type: condition iscommand: false brand: "" nexttasks: '#default#': - "6" "YES": - "5" separatecontext: false view: |- { "position": { "x": 50, "y": 545 } } note: false continueonerrortype: "" timertriggers: [] ignoreworker: false skipunavailable: false quietmode: 1 isoversize: false isautoswitchedtoquietmode: false "3": id: "3" taskid: aaa21aff-02c5-4930-81fc-c8f8e9085884 type: regular task: id: aaa21aff-02c5-4930-81fc-c8f8e9085884 version: -1 name: RunPollingCommand description: RunPollingCommand scriptName: RunPollingCommand type: regular iscommand: false brand: "" nexttasks: '#none#': - "1" scriptarguments: additionalPollingCommandArgNames: simple: ${inputs.AdditionalPollingCommandArgNames} additionalPollingCommandArgValues: simple: ${inputs.AdditionalPollingCommandArgValues} ids: simple: ${inputs.Ids} pollingCommand: simple: ${inputs.PollingCommandName} pollingCommandArgName: simple: ${inputs.PollingCommandArgName} separatecontext: false view: |- { "position": { "x": 50, "y": 195 } } note: false reputationcalc: 1 continueonerrortype: "" timertriggers: [] ignoreworker: false skipunavailable: false quietmode: 0 isoversize: false isautoswitchedtoquietmode: false "5": id: "5" taskid: 778e1007-f7ea-4ff6-89c4-cffc067165c4 type: title task: id: 778e1007-f7ea-4ff6-89c4-cffc067165c4 version: -1 name: Done description: Done type: title iscommand: false brand: "" separatecontext: false view: |- { "position": { "x": -170, "y": 740 } } note: false continueonerrortype: "" timertriggers: [] ignoreworker: false skipunavailable: false quietmode: 0 isoversize: false isautoswitchedtoquietmode: false "6": id: "6" taskid: db74b973-dc4a-499c-8d63-8df213685a1d type: regular task: id: db74b973-dc4a-499c-8d63-8df213685a1d version: -1 name: Scheduled Task Failed description: Scheduled Task Failed scriptName: PrintErrorEntry type: regular iscommand: false brand: "" scriptarguments: message: simple: GenericPollingScheduledTask encountered an error. separatecontext: false view: |- { "position": { "x": 280, "y": 725 } } note: false reputationcalc: 1 continueonerrortype: "" timertriggers: [] ignoreworker: false skipunavailable: false quietmode: 0 isoversize: false isautoswitchedtoquietmode: false view: |- { "linkLabelsPosition": { "2_5_YES": 0.48 }, "paper": { "dimensions": { "height": 770, "width": 830, "x": -170, "y": 50 } } } inputs: - key: Ids value: {} required: true description: List of IDs to poll playbookInputQuery: - key: PollingCommandName value: {} required: true description: Name of the polling command to run playbookInputQuery: - key: PollingCommandArgName value: simple: ids required: true description: Argument name of the polling command. playbookInputQuery: - key: Interval value: simple: "1" required: true description: Frequency that the polling command will run (minutes). playbookInputQuery: - key: Timeout value: simple: "10" required: true description: Amount of time to poll before declaring a timeout and resuming the playbook (in minutes). playbookInputQuery: - key: dt value: {} required: true description: "DT filter for polling IDs. Polling will stop when no results are returned. Use single quotes, for example: WildFire.Report(val.Status!=='Success').SHA256." playbookInputQuery: - key: AdditionalPollingCommandArgNames value: {} required: false description: "Names of additional arguments for the polling command, for example: (arg1,arg2,...)." playbookInputQuery: - key: AdditionalPollingCommandArgValues value: {} required: false description: "Values of the additional arguments for the polling command, for example: (value1,value2,...)." playbookInputQuery: - key: ExtractMode value: {} required: false description: Indicator Extraction mode for the command sequence. (In XSOAR 8 and above, for first run command set manually the RunPollingCommand task in the playbook, Advanced -> Indicator Extraction mode). playbookInputQuery: outputs: [] tests: - No test contentitemexportablefields: contentitemfields: {}