Welcome to the Alteryx Knowledge Base

Salesforce Custom OAuth Refresh Fails with "bad argument type for built-in operation" After Access Token Expires
user

Created/Edited - 8/8/2026 by Brice Kouamelan | Alteryx

Description

When using Salesforce Input or Output tools (v5.1.5) with Custom App OAuth authentication via DCM, workflows succeed on initial execution but fail after the Salesforce access token expires (1 hour). The tool detects the expired token and attempts to refresh, but fails with "bad argument type for built-in operation." This occurs on both Designer 2024.2 and 2025.2, even with freshly created DCM connections and credentials.

Issue

A custom OAuth authentication type in the Alteryx Salesforce v5 tools (v5.1.5) authenticates successfully at first, but after the SFDC session/token expires (about ~1 hour of inactivity / subsequent execution), the SalesforceInput tool fails. The workflow log shows:

  • SalesforceInput tool started.
  • Plugin class successfully loaded.
  • Authentication completed.
  • Access token has expired. Retrying to fetch a new token.
  • bad argument type for built-in operation
  • SalesforceInput tool done.

The underlying connector logs (SalesforceInput log file) reveal the actual Salesforce API rejection:

  • Status_code: 401 | Response: [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]
  • Status_code: 400 | Response: {"error":"unsupported_grant_type","error_description":"grant type not supported"}

The connector detects the expired access token (401), attempts a refresh, but Salesforce rejects the refresh request because the grant_type parameter sent by the connector is not recognised. The user-facing error ("bad argument type for built-in operation") is the connector's internal failure when handling this unexpected 400 response

Environment

Product: Designer, Server

Software Version: 2024.2, 2025.2

Connector / Tool: Salesforce Input / Salesforce Output (SFDC v5 tools)

Tool Version: v5.1.5 (py3.10)

Authentication: Custom App OAuth (Authorization Code + Refresh Token flow)

DCM: Enabled

Deployment Environment: Sandbox and Production

Connected App Scopes: api, refresh_token, offline_access

Prerequisites
  • Salesforce Connected App configured with Custom OAuth (Authorization Code + Refresh Token)
  • DCM enabled with Custom App credential type
  • Salesforce access token lifetime set to default (~1 hour) or custom (even 24 hours eventually expires)
  • Workflow scheduled or executed after the access token has expired
  • Refresh token is valid and has not been revoked


Cause

The Salesforce connector v5.1.5 constructs the token refresh request with an incorrect or unrecognised grant_type parameter. Salesforce expects grant_type=refresh_token but receives a value it does not support, returning a 400 Unsupported Grant Type error. The connector then fails to handle this error response, producing "bad argument type for built-in operation."


Salesforce Login History confirms that the Connected App configuration is correct, and that initial OAuth grants succeed. The failure is on the connector side when constructing the refresh token request.

Defect reference: TPM-5186

Resolution

There is currently no workaround for Custom App OAuth authentication. A fix is targeted for a future Salesforce Connector release.

Interim options (limited):

  • Built-In App OAuth: If the Alteryx Salesforce Managed Package is installed in your Salesforce org, you can use "Sign in via Internet Browser" instead of Custom App OAuth.
  • Increase session timeout. Your Salesforce admin can increase the session timeout to reduce the frequency of failures, but this does not eliminate the issue.

Contact Alteryx Support and reference TPM-5186 for updates on the fix.

Additional Information

Affected versions:

  • Salesforce Input/Output Connector v5.1.5
  • Designer 2024.2 and 2025.2

Not affected:

  • Built-In App OAuth ("Sign in via Internet Browser")
  • Basic Auth (being retired by Salesforce)
Was this article helpful?