{"record":{"id":"0a1ea69f51e9f2ae","repo":"temporalio/temporal","slug":"the-number-of-s-d-has-reached-the-per-workflow","errorCode":null,"errorMessage":"the number of %s, %d, has reached the per-workflow limit of %d","messagePattern":"the number of (.+?), (.+?), has reached the per-workflow limit of (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/history/api/respondworkflowtaskcompleted/workflow_size_checker.go","lineNumber":134,"sourceCode":"\tnumPending int,\n\terrLimit int,\n\tmetricName string,\n\tresourceName string,\n) error {\n\tkey := c.mutableState.GetWorkflowKey()\n\tlogger := log.With(\n\t\tc.logger,\n\t\ttag.WorkflowNamespaceID(key.NamespaceID),\n\t\ttag.WorkflowID(key.WorkflowID),\n\t\ttag.WorkflowRunID(key.RunID),\n\t)\n\n\tif withinLimit(numPending, errLimit) {\n\t\treturn nil\n\t}\n\tc.metricsHandler.Counter(metricName).Record(1)\n\t// nolint:err113\n\terr := fmt.Errorf(\n\t\t\"the number of %s, %d, has reached the per-workflow limit of %d\",\n\t\tresourceName,\n\t\tnumPending,\n\t\terrLimit,\n\t)\n\tlogger.Error(err.Error(), tag.Error(err))\n\treturn err\n}\n\nconst (\n\tPendingChildWorkflowExecutionsDescription = \"pending child workflow executions\"\n\tPendingActivitiesDescription              = \"pending activities\"\n\tPendingCancelRequestsDescription          = \"pending requests to cancel external workflows\"\n\tPendingSignalsDescription                 = \"pending signals to external workflows\"\n)\n\nfunc (c *workflowSizeChecker) checkIfNumChildWorkflowsExceedsLimit() error {\n\treturn c.checkCountConstraint(","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/service/history/api/respondworkflowtaskcompleted/workflow_size_checker.go#L116-L152","documentation":"Error \"the number of %s, %d, has reached the per-workflow limit of %d\" thrown in temporalio/temporal.","triggerScenarios":"Thrown at service/history/api/respondworkflowtaskcompleted/workflow_size_checker.go:134 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}