{"record":{"id":"b8400bac1e83df73","repo":"phacility/phabricator","slug":"specify-a-webhook-to-call-with-id","errorCode":null,"errorMessage":"Specify a webhook to call with \"--id\".","messagePattern":"Specify a webhook to call with \"--id\"\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/herald/management/HeraldWebhookCallManagementWorkflow.php","lineNumber":50,"sourceCode":"            'name' => 'count',\n            'param' => 'N',\n            'help' => pht('Make a total of __N__ copies of the call.'),\n          ),\n          array(\n            'name' => 'background',\n            'help' => pht(\n              'Instead of making calls in the foreground, add the tasks '.\n              'to the daemon queue.'),\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $viewer = $this->getViewer();\n\n    $id = $args->getArg('id');\n    if (!$id) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify a webhook to call with \"--id\".'));\n    }\n\n    $count = $args->getArg('count');\n    if ($count === null) {\n      $count = 1;\n    }\n\n    if ($count <= 0) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specified \"--count\" must be larger than 0.'));\n    }\n\n    $hook = id(new HeraldWebhookQuery())\n      ->setViewer($viewer)\n      ->withIDs(array($id))","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/herald/management/HeraldWebhookCallManagementWorkflow.php#L32-L68","documentation":"Usage error from 'bin/herald call-webhook' (HeraldWebhookCallManagementWorkflow) when the command is run without --id. --id is the numeric ID of the Herald webhook to fire and has no default, so the workflow aborts immediately after execute() starts.","triggerScenarios":"Running './bin/herald call-webhook' with no --id flag; a wrapper script that conditionally builds the flag and the condition evaluated false.","commonSituations":"Forgetting the flag in cron/CI scripts; assuming the command prompts interactively; copying the webhook PHID instead of the numeric ID and dropping it when it fails to parse.","solutions":["Find the webhook's numeric ID in the Webhooks UI (Herald > Webhooks, e.g. /webhook/) and pass '--id <id>'.","Combine with --object to fire a test against a real object: './bin/herald call-webhook --id 3 --object T123'."],"exampleFix":"// before\n./bin/herald call-webhook\n// after\n./bin/herald call-webhook --id 3 --object T123","handlingStrategy":"validation","validationCode":"// In shell wrappers, fail fast before invoking the workflow:\nif [ -z \"$WEBHOOK_ID\" ]; then\n  echo \"error: WEBHOOK_ID must be set (numeric webhook id from /webhook/)\" >&2\n  exit 1\nfi\nexec ./bin/herald call-webhook --id \"$WEBHOOK_ID\" --object \"$OBJECT\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fetch the webhook ID programmatically (e.g. via the webhooks UI or database) and inject it into scripts.","Treat a missing required CLI flag as a wrapper-script bug: validate argv before exec."],"tags":["herald","webhook","phabricator","cli","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}