Creates a new routine in the dataset. # IAM Permissions Requires the
`bigquery.routines.create` permission on the dataset.

## Arguments

| Parameters ||
|---|---|
| `datasetId` | `string` Required. Dataset ID of the new routine |
| `projectId` | `string` Required. Project ID of the new routine |
| `body` | `object (https://cloud.google.com/workflows/docs/reference/googleapis/bigquery/v2/Overview#Routine)` Required. |

## Raised exceptions

| Exceptions ||
|---|---|
| `ConnectionError` | In case of a network problem (such as DNS failure or refused connection). |
| `HttpError` | If the response status is \>= 400 (excluding 429 and 503). |
| `TimeoutError` | If a long-running operation takes longer to finish than the specified timeout limit. |
| `TypeError` | If an operation or function receives an argument of the wrong type. |
| `ValueError` | If an operation or function receives an argument of the right type but an inappropriate value. For example, a negative timeout. |

## Response

If successful, the response contains an instance of [`Routine`](https://cloud.google.com/workflows/docs/reference/googleapis/bigquery/v2/Overview#Routine).

## Subworkflow snippet

Some fields might be optional or required.
To identify required fields, refer to the [API documentation](https://cloud.google.com/bigquery/docs/reference/rest/v2/routines/insert).

### YAML

```yaml
- insert:
    call: googleapis.bigquery.v2.routines.insert
    args:
        datasetId: ...
        projectId: ...
        body:
            arguments: ...
            dataGovernanceType: ...
            definitionBody: ...
            description: ...
            determinismLevel: ...
            externalRuntimeOptions:
                containerCpu: ...
                containerMemory: ...
                containerRequestConcurrency: ...
                maxBatchingRows: ...
                runtimeConnection: ...
                runtimeVersion: ...
                volumeMounts: ...
            importedLibraries: ...
            language: ...
            pythonOptions:
                entryPoint: ...
                packages: ...
            remoteFunctionOptions:
                connection: ...
                endpoint: ...
                maxBatchingRows: ...
                userDefinedContext: ...
            returnTableType:
                columns: ...
            returnType:
                arrayElementType: ...
                rangeElementType: ...
                structType:
                    fields: ...
                typeKind: ...
            routineReference:
                datasetId: ...
                projectId: ...
                routineId: ...
            routineType: ...
            securityMode: ...
            sparkOptions:
                archiveUris: ...
                connection: ...
                containerImage: ...
                fileUris: ...
                jarUris: ...
                mainClass: ...
                mainFileUri: ...
                properties: ...
                pyFileUris: ...
                runtimeVersion: ...
            strictMode: ...
    result: insertResult
```

### JSON

```json
[
  {
    "insert": {
      "call": "googleapis.bigquery.v2.routines.insert",
      "args": {
        "datasetId": "...",
        "projectId": "...",
        "body": {
          "arguments": "...",
          "dataGovernanceType": "...",
          "definitionBody": "...",
          "description": "...",
          "determinismLevel": "...",
          "externalRuntimeOptions": {
            "containerCpu": "...",
            "containerMemory": "...",
            "containerRequestConcurrency": "...",
            "maxBatchingRows": "...",
            "runtimeConnection": "...",
            "runtimeVersion": "...",
            "volumeMounts": "..."
          },
          "importedLibraries": "...",
          "language": "...",
          "pythonOptions": {
            "entryPoint": "...",
            "packages": "..."
          },
          "remoteFunctionOptions": {
            "connection": "...",
            "endpoint": "...",
            "maxBatchingRows": "...",
            "userDefinedContext": "..."
          },
          "returnTableType": {
            "columns": "..."
          },
          "returnType": {
            "arrayElementType": "...",
            "rangeElementType": "...",
            "structType": {
              "fields": "..."
            },
            "typeKind": "..."
          },
          "routineReference": {
            "datasetId": "...",
            "projectId": "...",
            "routineId": "..."
          },
          "routineType": "...",
          "securityMode": "...",
          "sparkOptions": {
            "archiveUris": "...",
            "connection": "...",
            "containerImage": "...",
            "fileUris": "...",
            "jarUris": "...",
            "mainClass": "...",
            "mainFileUri": "...",
            "properties": "...",
            "pyFileUris": "...",
            "runtimeVersion": "..."
          },
          "strictMode": "..."
        }
      },
      "result": "insertResult"
    }
  }
]
```