Starts a new asynchronous job. This API has two different kinds of
endpoint URIs, as this method supports a variety of use cases. \* The
*Metadata* URI is used for most interactions, as it accepts the job
configuration directly. \* The *Upload* URI is ONLY for the case when
you're sending both a load job configuration and a data stream together.
In this case, the Upload URI accepts the job configuration and the data
as two distinct multipart MIME parts. # IAM Permissions Requires the
`bigquery.jobs.create` permission on the project resource. Additional
permissions are required depending on the job type: - **Load, Export,
and Copy jobs** : Generally require data-level permissions such as
`bigquery.tables.export` or access to external storage. - **Query
jobs**: Permissions are dependent on the SQL statement. Complex queries
(DDL, DCL) may require additional permissions to create reservations,
modify IAM policies, or update project settings.

This method waits---the workflow execution is paused---until the operation is
complete, fails, or times out. The default timeout value is `1800` seconds (30
minutes) and can be changed to a maximum value of `31536000` seconds (one year)
for long-running operations using the `connector_params` field.

The connector uses polling to monitor the long-running operation, which might
generate additional billable steps. The polling policy for the long-running
operation can be configured. For example, if you set `skip_polling` to `True`,
the connector invocation call is non-blocking if the initial request succeeds;
otherwise, retries might occur.

For more information about connector-specific parameters (`connector_params`),
see [Invoke a connector call](https://docs.cloud.google.com/workflows/docs/reference/googleapis#invoke_a_connector_call).

For more information about retries and long-running operations, see
[Understand connectors](https://docs.cloud.google.com/workflows/docs/connectors).

Learn more about how to [load data into BigQuery](https://docs.cloud.google.com/bigquery/docs/loading-data)
and how to [use schema auto-detection](https://docs.cloud.google.com/bigquery/docs/schema-detect).

## Arguments

| Parameters ||
|---|---|
| `projectId` | `string` Required. Project ID of project that will be billed for the job. |
| `body` | `object (https://cloud.google.com/workflows/docs/reference/googleapis/bigquery/v2/Overview#Job)` 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. |
| `OperationError` | If the long-running operation finished unsuccessfully. |
| `ResponseTypeError` | If the long-running operation returned a response of the wrong type. |

## Response

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

## 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/jobs/insert).

### YAML

```yaml
- insert:
    call: googleapis.bigquery.v2.jobs.insert
    args:
        projectId: ...
        body:
            configuration:
                copy:
                    createDisposition: ...
                    destinationEncryptionConfiguration:
                        kmsKeyName: ...
                    destinationExpirationTime: ...
                    destinationTable:
                        datasetId: ...
                        projectId: ...
                        tableId: ...
                    operationType: ...
                    sourceTable: ...
                    sourceTables: ...
                    writeDisposition: ...
                dryRun: ...
                extract:
                    compression: ...
                    destinationFormat: ...
                    destinationUri: ...
                    destinationUris: ...
                    fieldDelimiter: ...
                    modelExtractOptions:
                        trialId: ...
                    nativeGeographyExportEnabled: ...
                    printHeader: ...
                    sourceModel:
                        datasetId: ...
                        modelId: ...
                        projectId: ...
                    sourceTable: ...
                    useAvroLogicalTypes: ...
                jobTimeoutMs: ...
                labels: ...
                load:
                    allowJaggedRows: ...
                    allowQuotedNewlines: ...
                    autodetect: ...
                    clustering:
                        fields: ...
                    columnNameCharacterMap: ...
                    connectionProperties: ...
                    copyFilesOnly: ...
                    createDisposition: ...
                    createSession: ...
                    dateFormat: ...
                    datetimeFormat: ...
                    decimalTargetTypes: ...
                    destinationEncryptionConfiguration: ...
                    destinationTable: ...
                    destinationTableProperties:
                        description: ...
                        expirationTime: ...
                        friendlyName: ...
                        labels: ...
                    encoding: ...
                    fieldDelimiter: ...
                    fileSetSpecType: ...
                    hivePartitioningOptions:
                        mode: ...
                        requirePartitionFilter: ...
                        sourceUriPrefix: ...
                    ignoreUnknownValues: ...
                    jsonExtension: ...
                    maxBadRecords: ...
                    nullMarker: ...
                    nullMarkers: ...
                    parquetOptions:
                        enableListInference: ...
                        enumAsString: ...
                        mapTargetType: ...
                    preserveAsciiControlCharacters: ...
                    projectionFields: ...
                    quote: ...
                    rangePartitioning:
                        field: ...
                        range:
                            end: ...
                            interval: ...
                            start: ...
                    referenceFileSchemaUri: ...
                    schema:
                        fields: ...
                        foreignTypeInfo:
                            typeSystem: ...
                    schemaInline: ...
                    schemaInlineFormat: ...
                    schemaUpdateOptions: ...
                    skipLeadingRows: ...
                    sourceColumnMatch: ...
                    sourceFormat: ...
                    sourceUris: ...
                    timeFormat: ...
                    timePartitioning:
                        expirationMs: ...
                        field: ...
                        requirePartitionFilter: ...
                        type: ...
                    timeZone: ...
                    timestampFormat: ...
                    timestampTargetPrecision: ...
                    useAvroLogicalTypes: ...
                    writeDisposition: ...
                maxSlots: ...
                query:
                    allowLargeResults: ...
                    clustering: ...
                    connectionProperties: ...
                    continuous: ...
                    createDisposition: ...
                    createSession: ...
                    defaultDataset:
                        datasetId: ...
                        projectId: ...
                    destinationEncryptionConfiguration: ...
                    destinationTable: ...
                    flattenResults: ...
                    maximumBillingTier: ...
                    maximumBytesBilled: ...
                    parameterMode: ...
                    preserveNulls: ...
                    priority: ...
                    query: ...
                    queryParameters: ...
                    rangePartitioning: ...
                    schemaUpdateOptions: ...
                    scriptOptions:
                        keyResultStatement: ...
                        statementByteBudget: ...
                        statementTimeoutMs: ...
                    secureContext:
                        secureParameterEntries: ...
                    tableDefinitions: ...
                    timePartitioning: ...
                    useLegacySql: ...
                    useQueryCache: ...
                    userDefinedFunctionResources: ...
                    writeDisposition: ...
                    writeIncrementalResults: ...
                reservation: ...
            jobReference:
                jobId: ...
                location: ...
                projectId: ...
    result: insertResult
```

### JSON

```json
[
  {
    "insert": {
      "call": "googleapis.bigquery.v2.jobs.insert",
      "args": {
        "projectId": "...",
        "body": {
          "configuration": {
            "copy": {
              "createDisposition": "...",
              "destinationEncryptionConfiguration": {
                "kmsKeyName": "..."
              },
              "destinationExpirationTime": "...",
              "destinationTable": {
                "datasetId": "...",
                "projectId": "...",
                "tableId": "..."
              },
              "operationType": "...",
              "sourceTable": "...",
              "sourceTables": "...",
              "writeDisposition": "..."
            },
            "dryRun": "...",
            "extract": {
              "compression": "...",
              "destinationFormat": "...",
              "destinationUri": "...",
              "destinationUris": "...",
              "fieldDelimiter": "...",
              "modelExtractOptions": {
                "trialId": "..."
              },
              "nativeGeographyExportEnabled": "...",
              "printHeader": "...",
              "sourceModel": {
                "datasetId": "...",
                "modelId": "...",
                "projectId": "..."
              },
              "sourceTable": "...",
              "useAvroLogicalTypes": "..."
            },
            "jobTimeoutMs": "...",
            "labels": "...",
            "load": {
              "allowJaggedRows": "...",
              "allowQuotedNewlines": "...",
              "autodetect": "...",
              "clustering": {
                "fields": "..."
              },
              "columnNameCharacterMap": "...",
              "connectionProperties": "...",
              "copyFilesOnly": "...",
              "createDisposition": "...",
              "createSession": "...",
              "dateFormat": "...",
              "datetimeFormat": "...",
              "decimalTargetTypes": "...",
              "destinationEncryptionConfiguration": "...",
              "destinationTable": "...",
              "destinationTableProperties": {
                "description": "...",
                "expirationTime": "...",
                "friendlyName": "...",
                "labels": "..."
              },
              "encoding": "...",
              "fieldDelimiter": "...",
              "fileSetSpecType": "...",
              "hivePartitioningOptions": {
                "mode": "...",
                "requirePartitionFilter": "...",
                "sourceUriPrefix": "..."
              },
              "ignoreUnknownValues": "...",
              "jsonExtension": "...",
              "maxBadRecords": "...",
              "nullMarker": "...",
              "nullMarkers": "...",
              "parquetOptions": {
                "enableListInference": "...",
                "enumAsString": "...",
                "mapTargetType": "..."
              },
              "preserveAsciiControlCharacters": "...",
              "projectionFields": "...",
              "quote": "...",
              "rangePartitioning": {
                "field": "...",
                "range": {
                  "end": "...",
                  "interval": "...",
                  "start": "..."
                }
              },
              "referenceFileSchemaUri": "...",
              "schema": {
                "fields": "...",
                "foreignTypeInfo": {
                  "typeSystem": "..."
                }
              },
              "schemaInline": "...",
              "schemaInlineFormat": "...",
              "schemaUpdateOptions": "...",
              "skipLeadingRows": "...",
              "sourceColumnMatch": "...",
              "sourceFormat": "...",
              "sourceUris": "...",
              "timeFormat": "...",
              "timePartitioning": {
                "expirationMs": "...",
                "field": "...",
                "requirePartitionFilter": "...",
                "type": "..."
              },
              "timeZone": "...",
              "timestampFormat": "...",
              "timestampTargetPrecision": "...",
              "useAvroLogicalTypes": "...",
              "writeDisposition": "..."
            },
            "maxSlots": "...",
            "query": {
              "allowLargeResults": "...",
              "clustering": "...",
              "connectionProperties": "...",
              "continuous": "...",
              "createDisposition": "...",
              "createSession": "...",
              "defaultDataset": {
                "datasetId": "...",
                "projectId": "..."
              },
              "destinationEncryptionConfiguration": "...",
              "destinationTable": "...",
              "flattenResults": "...",
              "maximumBillingTier": "...",
              "maximumBytesBilled": "...",
              "parameterMode": "...",
              "preserveNulls": "...",
              "priority": "...",
              "query": "...",
              "queryParameters": "...",
              "rangePartitioning": "...",
              "schemaUpdateOptions": "...",
              "scriptOptions": {
                "keyResultStatement": "...",
                "statementByteBudget": "...",
                "statementTimeoutMs": "..."
              },
              "secureContext": {
                "secureParameterEntries": "..."
              },
              "tableDefinitions": "...",
              "timePartitioning": "...",
              "useLegacySql": "...",
              "useQueryCache": "...",
              "userDefinedFunctionResources": "...",
              "writeDisposition": "...",
              "writeIncrementalResults": "..."
            },
            "reservation": "..."
          },
          "jobReference": {
            "jobId": "...",
            "location": "...",
            "projectId": "..."
          }
        }
      },
      "result": "insertResult"
    }
  }
]
```