Dynamic Credential Provider

Prépare les credentials dynamiques pour être utilisés dans le workflow

Overview

This node, named "Dynamic Credential Provider," is designed to process dynamic credentials within an n8n workflow. It supports two main operations: formatting and validating credentials for specific Microsoft-related credential types. The node is useful when you need to prepare or verify credentials dynamically during workflow execution, especially for Microsoft Graph, Microsoft Outlook OAuth2, and Microsoft Entra OAuth2 credentials.

Practical examples include:

  • Formatting freshly obtained OAuth tokens into a standardized structure for downstream nodes.
  • Validating that required token fields exist before making API calls, preventing runtime errors.

Properties

Name Meaning
Type de Credential The type of credential to process. Options are: Microsoft Graph, Microsoft Outlook OAuth2, Microsoft Entra OAuth2.

Output

The node outputs an array of items with the following JSON structure depending on the operation:

  • Format Credentials:
    Each item includes the original data plus a new _n8n_credentials field containing:

    • id: The original credential ID.
    • name: A generated name combining "Dynamic", the credential type, and the current timestamp.
    • type: The credential type selected.
    • data: An object with formatted token details such as access_token, expires_in, refresh_token, scope, and token_type. Default values are provided where missing (e.g., expires_in defaults to 3600 seconds, token_type defaults to "Bearer").
  • Validate Credentials:
    Each item includes the original data plus a credentialValidation field containing:

    • isValid: Boolean indicating if all required fields are present.
    • missingFields: Array listing any missing required fields (e.g., access_token).
    • credentialType: The type of credential validated.

No binary data output is produced by this node.

Dependencies

  • Requires input items to contain a dynamicCredentials JSON property with credential data structured as expected.
  • No external API calls are made by this node itself; it only processes existing credential data.
  • No special environment variables or external service configurations are needed beyond providing valid dynamic credentials in the input.

Troubleshooting

  • Error: "Les credentials dynamiques n'ont pas été trouvés dans l'item X"
    This error occurs if an input item lacks the required dynamicCredentials property. Ensure that previous nodes provide this data correctly.

  • Validation fails (isValid false) with missing fields listed
    Indicates that the credential data is incomplete. Check upstream nodes or credential generation steps to ensure all required token fields (like access_token) are present.

  • Unexpected credential type
    If a credential type outside the supported list is used, the node will pass through the data without formatting or validation. Confirm the credential type matches one of the supported options.

Links and References

Discussion