ERPNext Create Material Request Node icon

ERPNext Create Material Request Node

Creates a Material Request in ERPNext

Overview

This node creates a Material Request in the ERPNext system based on input data. It is designed to automate the process of generating material requests when certain conditions are met, specifically when the status of an item is not "available". This can be useful in inventory management or procurement workflows where materials need to be requested automatically if they are not currently available.

For example, if you have a workflow that checks the availability of materials and finds some are unavailable, this node can create corresponding material requests in ERPNext to initiate procurement or production processes.

Properties

Name Meaning
Material Check Result The material check result to create a material request for. This is a required string input.

Output

The node outputs an array of JSON objects, each representing the result of processing an input item:

  • If the input item's status field is "available" or missing, the output for that item will indicate it was skipped with:
    {
      "success": false,
      "message": "Skipped because status is available"
    }
    
  • Otherwise, the node attempts to create a material request via a utility function and outputs:
    {
      "material_request": { ... }
    }
    
    where the material_request object contains the details returned from the creation operation in ERPNext.

No binary data output is produced by this node.

Dependencies

  • Requires credentials for ERPNext API access, including:
    • ERPNext domain URL
    • API key
    • API secret
  • Uses an external utility function (createMaterialRequest) to perform the actual API call to ERPNext.
  • The node expects these credentials to be configured in n8n before execution.

Troubleshooting

  • Common issues:

    • Missing or invalid ERPNext credentials will cause authentication failures.
    • Input items without a status property or with status set to "available" will be skipped; ensure your input data is correctly formatted.
    • Network or API errors during material request creation will throw errors.
  • Error messages:

    • Errors thrown by the utility function or API calls will be wrapped as node operation errors. Check the error message for details such as authentication failure, invalid domain, or malformed requests.
  • Resolution tips:

    • Verify ERPNext credentials and domain URL.
    • Ensure input data includes the necessary status field.
    • Confirm network connectivity to the ERPNext instance.

Links and References

Discussion