Skip to main content

Input params

Process edition includes a second editor, in this case a JSON one.

This is used to define the process input parameters, that will be rendered as a form to ask users for information when they want to start one on demand or scheduled execution.

This form specification will be also used to define the webhooks body object.

Then you could read this parameters object using the helper:

const {
context: { parameters },
} = yepcode;

With parameters definition you could ask for any input needed to run your process.

Input forms can be as complex as you may need:

And that parameters definition can be tested to check how the form will be rendered, so feel free to change and test until you can ask for all the needed information.

Parameters definition

The JSON that defines input params follows json-shema definition.

However, YepCode offers some extra attributes which will help to improve your experience:

Sensitive properties

These properties will be treated as passwords, so they will be stored encrypted in db and they won't be shown in the UI. Here you have an example of a simple form with a sensitive property:

{
"title": "Input parameters",
"type": "object",
"properties": {
"apiKey": {
"title": "The API Key",
"type": "string",
"isSensitive": true
}
},
"required": ["apiKey"]
}

Transient properties

These transient properties will only be available for the execution, they won't be stored in database. An execution which receives transient parameters cannot be rerun, as these type of parameters won't be available. In the UI they will be shown with the [transient] replacement. Here you have an example of a simple form with a transient property:

{
"title": "Input parameters",
"type": "object",
"properties": {
"fileContent": {
"title": "The content of the file",
"type": "string",
"isTransient": true
}
},
"required": ["fileContent"]
}

Validation

This form specification supports validations, and it would be used on form submit, but that validation won't be checked if execution is started using non submit form methods (ie: webhooks).

Full sample

Here you have a full JSON schema sample ready to be pasted in the input params editor:

{
"title": "User registration form title",
"description": "This is a sample form specification showing all attribute types",
"type": "object",
"properties": {
"name": {
"title": "Your name",
"type": "string"
},
"password": {
"title": "Your password",
"type": "string",
"isSensitive": true,
"ui": {
"ui:placeholder": "Use a secure password"
}
},
"oneHiddenField": {
"title": "Hidden field",
"type": "string",
"ui": {
"ui:widget": "hidden"
}
},
"height": {
"title": "Your weight",
"description": "Values must be between 0 and 500",
"type": "integer",
"minimum": 0,
"maximum": 500
},
"withYepCodeAccount": {
"title": "I have a YepCode account",
"type": "boolean"
},
"yourEmail": {
"title": "Your email",
"type": "string",
"format": "email"
},
"favoriteColor": {
"title": "Your favorite color",
"type": "string",
"ui": {
"ui:widget": "color"
}
},
"resume": {
"title": "Your CV",
"type": "string",
"ui": {
"ui:widget": "file"
}
},
"location": {
"title": "Where do you live?",
"description": "It's a geographical coordinate.",
"required": [
"latitude",
"longitude"
],
"type": "object",
"properties": {
"latitude": {
"type": "number",
"minimum": -90,
"maximum": 90
},
"longitude": {
"type": "number",
"minimum": -180,
"maximum": 180
}
}
},
"previousCompanies": {
"title": "What companies have you worked for?",
"type": "array",
"items": {
"type": "string"
}
},
"referals": {
"title": "Tell us about some co-worker referals",
"type": "array",
"items": {
"type": "object",
"properties": {
"referalName": {
"description": "Referal person name",
"type": "string"
},
"referalEmail": {
"description": "Referal person email",
"type": "string"
}
}
}
},
"yourFavoriteOperatingSystem": {
"type": "string",
"title": "Your favorite operating system?",
"ui": {
"ui:widget": "radio"
},
"enum": [
"MacOS",
"Windows",
"Linux"
]
},
"yourFavoriteProgrammingLanguage": {
"type": "string",
"title": "Your favorite programming language?",
"ui": {
"ui:placeholder": "Pick one option"
},
"enum": [
"Javascript",
"Java",
"Kotlin",
"Ruby",
"Php",
"Pascal",
"Cobol"
]
},
"otherProgrammingLanguages": {
"type": "array",
"items": {
"type": "string",
"enum": [
"Javascript",
"Java",
"Kotlin",
"Ruby",
"Php",
"Pascal",
"Cobol"
]
},
"title": "Other programming languages you have worked with?"
}
},
"required": [
"name",
"birthYear"
]
}