Skip to content

Composite Connector Reference

Field, variable, and error reference for Composite Connectors.

Step fields

Each step in a composite connector's steps array supports the following fields.

FieldTypeRequiredDefaultDescription
namestringYesUnique step identifier used as steps.<name> in templates. Slug format: lowercase letters, digits, and hyphens (e.g. auth, fetch-user). Use bracket notation for hyphenated names: steps['fetch-user'].body.
urlstringYesHTTPS URL for the API call. Supports Jinja2 templates.
methodstringNoGETHTTP method. One of GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS.
headersarrayNo[]Request headers as {key, value, overridable} objects. overridable defaults to false when omitted.
query_parametersarrayNo[]URL query parameters as {key, value, overridable} objects.
authenticationobjectNononeAuthentication strategy as {type, config}. Same options as regular connectors — see Authentication.
request_bodystringNo""Jinja2 template for the request body.
response_bodystringNo""Jinja2 template applied to the step's response before the result is stored in steps.<name>.body.
response_content_typestringNo""Content-Type override. Applies only to the final step's response returned to the widget.

Step result variables

After a step completes, its response is available to subsequent steps and to the final response:

VariableTypeDescription
steps.<name>.bodystring or NoneResponse body as a UTF-8 string. None when the response is binary. If the step has a response_body template, this holds the transformed output instead of the raw body.
steps.<name>.status_codeintegerHTTP status code returned by the step.
steps.<name>.headersdictResponse headers (lowercase keys).

Request data

The client's request data is exposed to step templates via the request object:

VariableTypeDescription
request.body_textstring or NoneRequest body as text. None when the body is binary or empty.
request.body_rawbinary or NoneRequest body as raw binary. Use body_text for text payloads.
request.headersdictOnly Content-Type is available. Other client headers are not forwarded to step templates.
request.query_parametersdictQuery parameters from the client's request URL.

Available in step templates

Each step template has access to the following variables and functions:

Variable or functionURL and request body templatesHeader, query param, and authentication templatesResponse body templates
steps.<name>.*YesYesYes
request.*YesYesYes
user.*YesYesYes
tenant_idYesYesYes
get_secret()NoYesNo
jwt_encode()YesYesNo
now()YesYesYes

For the full list of Jinja2 filters and functions, see Template Variables.

SDK

sdk.connectors.composite.execute(options) executes a composite connector from widget code and returns a Promise that resolves with the parsed response body.

ParameterTypeRequiredDescription
options.permalinkstringYesThe composite connector's permalink or numeric ID.
options.payloadobjectNoRequest body forwarded as the POST payload. Pass a plain object — the SDK handles serialisation. Do not pass a JSON.stringify'd string.
options.queryParamsobjectNoQuery parameters appended to the request URL. Available in step templates as request.query_parameters.<key>.

The HTTP method is always POST. It is not configurable by the caller — the SDK owns this detail.

html
<script>
(async () => {
  const sdk = new window.WidgetServiceSDK();
  try {
    const data = await sdk.connectors.composite.execute({
      permalink: "auth-and-fetch-user",
      payload: { userId: "usr_123" },
      queryParams: { format: "json" }
    });
    console.log("Result:", data);
  } catch (error) {
    console.error("Connector request failed:", error);
  }
})();
</script>

Errors (step 4xx/5xx, template errors, network errors) reject the returned Promise with an error object consistent with errors thrown by sdk.connectors.execute().

Response headers

HeaderDescription
Server-TimingPer-step duration entries (step.<name>;dur=<ms>) plus total.
X-Connector-TimingJSON object with per-step timing breakdown.

Error responses

All step failures return a JSON error envelope whose errors.scope identifies the step:

ScenarioHTTP statuserrors.scope
Step returns HTTP 4xx/5xx502Composite step '<name>' (index <N>): Downstream (HTTP error)
Step network error502Composite step '<name>' (index <N>): Downstream (network/external service)
Step template rendering error422Composite step '<name>' (index <N>): Configuration (template rendering)
Step JWT signing error422Composite step '<name>' (index <N>): Authentication (JWT signing)
Composite has no steps500Unexpected error

No data from previous successful steps is included in error responses.

Limitations

  • Steps execute sequentially. Parallel execution is not supported.
  • Composite connectors are managed exclusively through the repository registry. No admin UI or API endpoints for CRUD.
  • The response returned to the widget is always the last step's response. There is no composite-level response template.
  • Each step is a standalone definition. Steps cannot reference existing regular connectors by permalink.

Next Steps

Gainsight CC Developer Portal