Project Source Code
Each project in Instalink can be fully described by YAML formatted source code. Accessing the source code makes it possible to perform advanced operations including copy and paste, reparenting actions, find and replace, etc. The source code can be accessed by clicking the "Code" button at the top of the project management view.
Editing Project Source Code
Generally it is NOT recommended to directly edit the source code of a project as most all common project editing operations can be performed within the user interface. Editing project source code should be done with caution. However, it is always possible to revert any changes to the project using the project history feature.
Project source code may contain the following top level sections.
project
The following properties are accessible within project scope of the source code.
- active
Set to `true` to deploy project to the Instalink servers. Set to `false` to prevent the project from executing. - basePath
This is the folder path that is prepended onto all LISTEN actions within the project. - buildNumber
This number increments any time any update is performed on the project. This value is not editable but always appears to help correlate the source code with a deployment of the project to the Instalink servers. - name
The name of the project. - versionNumber
The identifier that declares the version of the project within a connector. Multiple projects of the same name may exist within the connector. Projects with higher version numbers are considered to be the latest versions used within the connector.
Project Example
project:
active: true
basePath: /cards
buildNumber: 82
name: Card Game
versionNumber: 0.0.0
processes
All actions defined in the project are contained within the "processes" section of the source code. Each processes object follows the following general format:
[ACTION_ID]:
[ACTION_TYPE]:
[...ACTION_PROPERTIES...]
ACTION_ID
The ACTION_ID key should contain the internal GUID identifier for the action. This property is always
automatically generated by the system. Once the action is saved, the identifier is maintained by the system. The original action
is considered deleted if the ACTION_ID key is changed in the source code. When inserting new actions, any value may be used as
the ACTION_ID key. The only requirement is that the value is unique within the scope of the project actions and all references to
the inserted ACTION_ID key are consistent. For example if "A" used as the ACTION_ID, then everywhere else in the project that
this action is referenced should also refer to the key "A". Once the project source code is saved, the key used for the ACTION_ID
is always replaced by the system generated GUID. This makes it possible to copy any actions from any project to any other project.
ACTION_TYPE
The ACTION_TYPE key should always reference the internal identifier of the action type. The following are valid action
types:
- LISTEN
- SEND_TO_URL
- REDIRECT_TO_URL
- FTPS
- SEND_MESSAGE
- CHECK_DATA
- TRANSFORM_DATA
- ITERATE
- RESPOND_SUCCESS
- LOG_NEUTRAL
- RESPOND_FAILURE
- DATABASE_WRITE
- DATABASE_READ
- CRON
- SCHEDULE
- UNSCHEDULE
- RETURN_TO_ITERATOR
- RETURN_ERROR_TO_ITERATOR
- APPEND_TO_QUEUE
- REAPPEND_TO_QUEUE
- FAIL_QUEUE
- SESSION_STORE
- SESSION_READ
- DEFINE_ACTION
- RUN_ACTION
- ACTION_CALLBACK
- ACTION_HANDLER
- PROGRESS_TOTAL
- PROGRESS_UPDATE
ACTION_PROPERTIES
A plurality of contextual action properties may be included in the ACTION_PROPERTIES section of a process record.
Click on any of the ACTION_TYPE links above to view the properties that may be included in this section. The properties
are contextual which means that any property that is not applicable to the selected ACTION_TYPE will be ignored.
In addition to the contextual action properties, the ACTION_PROPERTIES section also allows for properties that are globally applicable to any action type.
- sample_input
This property is applicable to LISTEN, ACTION_HANDLER, RUN_ACTION, SESSION_READ, FTPS, DATABASE_WRITE, DATABASE_READ, and SEND_TO_URL. Enter a json formatted sub-document that can be used by the process data inspector. - then
A list of action key identifiers that will be the children of this action and operate on the THEN operator. - else
A list of action key identifiers that will be the children of this action and operate on the ELSE operator. - finally
A list of action key identifiers that will be the children of this action and operate on the FINALLY operator. - operator
The logical branch that will execute the action. - status
A flag that instructs the service to either execute or ignore the process within the data flow. Can be one of: ON, OFF, SKIPTO_THEN, or SKIPTO_ELSE. - description
Short text that briefly explains what the process is doing. The description is generated automatically on all action types except TRANSFORM_DATA. The description will not be overwritten on TRANSFORM_DATA actions.
Processes Example
processes:
5f515429ba023c80b756a1f9:
LISTEN:
customPath: /deck/draw
description: if receive call at /deck/draw
operator: IF
recordIdentifierTemplate: 'Draw From Deck ${name}'
status: 'ON'
then:
- 5f515498ba023c80b756a1fd
UrlKey: 458ca289-3778-4eb7-8d41-b03cd246ff7e
5f515498ba023c80b756a1fd:
SESSION_READ:
description: 'then read session from deck:${name}'
fields:
5f5154c7ba023c80b756a1fe:
key: cards
value: ''
5f5154c7ba023c80b756a1ff:
key: hands
value: ''
namespace: 'deck:${name}'
operator: THEN
outKey: deck
status: 'ON'
then:
- 5f5154dcba023c80b756a200
5f5154dcba023c80b756a200:
CHECK_DATA:
conditions:
5f515503ba023c80b756a201:
checkKey: deck.cards.length
compareAs: GREATER_THAN
findIn: parameters
value: '0'
description: then if deck.cards.length greater than 0
else:
- 5f515507ba023c80b756a202
operator: THEN
status: 'ON'
then:
- 5f51552fba023c80b756a204
5f515507ba023c80b756a202:
RESPOND_FAILURE:
description: 'else respond with 400 error, No more cards to draw'
errorMessage: No more cards to draw
fields:
5f515521ba023c80b756a203:
key: error
value: No more cards to draw
logError: false
logSuccess: false
operator: ELSE
status: 'ON'
5f51552fba023c80b756a204:
TRANSFORM_DATA:
description: then Draw N Cards
operator: THEN
status: 'ON'
then:
- 5f515721ba023c80b756a20b
transforms:
5f515603ba023c80b756a205:
arg1: '0'
arg2: '${amount}'
fromKey: deck.cards
toKey: hand
transformAs: ARRAY_SUB
5f5156ceba023c80b756a209:
arg1: '${amount}'
arg2: '52'
fromKey: deck.cards
toKey: deck.cards
transformAs: ARRAY_SUB
vars
The vars section contains all the project variables attached to the project. Each var is an object with a GUID as the key and the following properties.
- key
The key that is used to reference the project variables value within the process data. - value
The value of the variable. Will always display as "xxxxxxx" if the project variable's hidden flag is set to `true`. - hidden
Set to `true` to ensure that whatever data is entered as the value within the Instalink admin panel is never displayed within the source code output. Use this for sensitive values such as passwords, tokens, or API keys that should not be shared with any other party.
Vars Example
vars:
6169e6615a39509c64af186d:
hidden: false
key: test
value: THIS IS A TEST VALUE
6169e6615a39509c64af186e:
hidden: true
key: password
value: xxxxxxxxxx
connectors
The connectors section contains all the project connectors that are attached to the project. Each connector is an object with a GUID as the key and the following properties.
- connectorId
The GUID identifier of the connector being used. - connectorVersionId
The GUID identifier of the connector's project version.
Connectors Example
connectors:
6169e8a8f1ba8d9d268b85d7:
connectorId: 60145bc9969bd3ebaea1d2c6
connectorVersionId: 60145be3969bd3ebaea1d2c7
authorizations
The authorizations section contains all the authorization records that are attached to the project. Each authorization record is an object with a GUID as the key and the following properties.
- description
Plain text label used to refer to the authorization record. - type
Can be one of the following: Basic, Digest, OAuth, OAuth2, Instalink, Consumer. - basicAuth_username
Value used as the username when generating a hash for basic header authorization. - basicAuth_password
Value used as the password when generating a hash for basic header authorization. Value is always hidden in the source code. - oauth1_consumerKey
Value is used as the consumer key when generating a hash for Oauth1 authorization. - oauth1_consumerSecret
Value is used as the consumer secret when generating a hash for Oauth1 authorization. Value is always hidden in the source code. - oauth1_realm
Value is used as the realm when generating a hash for Oauth1 authorization. - oauth1_tokenKey
Value is used as the token key when generating a hash for Oauth1 authorization. - oauth1_tokenSecret
Value is used as the consumer secret when generating a hash for Oauth1 authorization. Value is always hidden in the source code. - instalinkauth_user
The GUID identifier of the Instalink user whose long-lived token will have access to the endpoint. - consumerauth_user
The GUID identifier of the Instalink account consumer record whose long-lived token will have access to the endpoint.
Authorizations Example
authorizations:
66b29802ea82f66a2a7ce9f8:
basicAuth_password: xxxxxxxxxx
basicAuth_username: username
consumerauth_user: ''
description: Basic Auth
instalinkauth_user: ''
oauth1_consumerKey: ''
oauth1_consumerSecret: xxxxxxxxxx
oauth1_realm: ''
oauth1_tokenKey: ''
oauth1_tokenSecret: xxxxxxxxxx
type: Basic
databases
The authorizations section contains all the database connection definitions that are attached to the project. Each database connection definition is an object with a GUID as the key and the following properties.
- name
Plain text label used to refer to the database connection. - engine
Can be one of the following: mysql, postgresql, mssql, oracledb. - host
The public domain or IP address that is listening for database connections. - user
Value used to identify the user when logging into the database. - password
Value is used as the password key when logging into the database. Value is always hidden in the source code. - options
A url query string that is appended on to the connection URI. Used to modify options on the connection to the database. - databaseName
The name of the database that should be selected when connecting to the database server. - port
The port address that the database server is listening for database connections. - requestTimeout
The number of milliseconds that the request will wait before it gives up on a request or a query. Defaults to 15000 (15 seconds).
Databases Example
databases:
66ba58053f35ff13e0cc2190:
databaseName: testdb
engine: mysql
host: localhost
name: Test DB
options: ''
password: xxxxxxxxxx
port: '3306'
requestTimeout: 15000
user: root
secrets
The secrets section contains all the secret keys that are attached to the project. Secrets are generally encrypted keys that are stored with encryption at rest. In the project source code, each secret record is an object with a GUID as the key and the following properties. It is not advisable or intended for users to directly modify project secrets from the source code. When copying and pasting a project that contains a secret key, it will be necessary to update the properties of the newly created key record using the Instalink interface.
- label
Plain text label used to refer to the secret record. - secretType
Can be one of the following: SSH_KEY. - dataCipher
The binary representation of the value used to decrypt the key. Value is always hidden in the source code. - sshPassphraseCipher
The binary representation of the passphrase used to decrypt the key. Value is always hidden in the source code. - encryptionKeyId
The GUID identifier that references the storage location of the encryption key in the database. Value is always hidden in the source code.
Secrets Example
secrets:
67d8a7272a26a766161bf57a:
dataCipher: xxxxxxxxxx
encryptionKeyId: xxxxxxxxxx
label: TEST secret
secretType: SSH_KEY
sshPassphraseCipher: xxxxxxxxxx
Important Things to Note
- The system will never directly store the raw edits that a user makes to the source code. Instead the system will parse and interpret the raw source code and then generate a new clean representation of the project according to its own internal logic and validation rules.
- To maintain consistency in the source code when comparing versions, the system will always order the top level sections in the following order: project, processes, vars, connectors, authorizations, databases, and secrets. The system will accept these properties out of order on a raw edit, but will always return the sections in this order.
- To maintain consistency in the source code when comparing versions, the system will always sort sub-record objects alphabetically by their key. The system will accept sub-record objects out of order on a raw edit, but will always return the file with the keys sorted alphabetically.
- To maintain consistency in the source code when comparing versions, the system will always sort objects alphabetically by their key. The system will accept object properties out of order on a raw edit, but will always return the file with the properties sorted alphabetically.
- The project source code conforms to standard YAML formatting. It supports the ability to include arrays, objects, a and inline documents. Please refer to online resources on YAML formatting for additional details on the syntax that should be used when editing project source code.
- All properties on a sub-record are optional. If a property is not included in the source code, then it is assumed to have the default value. The source code will not display the property if it has the default value in most circumstances.