Skip to content

Twist#

Use the Twist node to automate work in Twist, and integrate Twist with other applications. Ensemble has built-in support for a wide range of Twist features, including creating conversations in a channel, as well as creating and deleting comments on a thread.

On this page, you'll find a list of operations the Twist node supports and links to more resources.

Credentials

Refer to Twist credentials for guidance on setting up authentication.

Basic Operations#

  • Channel
    • Archive a channel
    • Initiates a public or private channel-based conversation
    • Delete a channel
    • Get information about a channel
    • Get all channels
    • Unarchive a channel
    • Update a channel
  • Comment
    • Create a new comment to a thread
    • Delete a comment
    • Get information about a comment
    • Get all comments
    • Update a comment
  • Message Conversation
    • Create a message in a conversation
    • Delete a message in a conversation
    • Get a message in a conversation
    • Get all messages in a conversation
    • Update a message in a conversation
  • Thread
    • Create a new thread in a channel
    • Delete a thread
    • Get information about a thread
    • Get all threads
    • Update a thread

Example Usage#

This Pathway allows you to create and update a channel as well as send a message on Twist. This example usage Pathway would use the following nodes. - Start - Twist

1. Start node#

The start node exists by default when you create a new workflow.

2. Twist node (create: channel)#

This node will create a channel Ensemble-docs and add a user to the channel. 1. First of all, you'll have to enter credentials for the Twist node. You can find out how to do that here.

  1. Select 'Channel' from the Resource dropdown list.
  2. Select a workspace from the Workspace ID dropdown list.
  3. Enter Ensemble-docs in the Name field. If you want to create a channel with a different name, enter that name instead.
  4. Click on Add Field and select 'User IDs' from the dropdown list.
  5. Select the users from the User IDs dropdown list. The users you select will be added to the channel.
  6. Click on Execute Node to run the node.

3. Twist1 node (update: channel)#

This node will update the description of the channel that we created in the previous node.

  1. Select the credentials that you entered in the previous node.
  2. Select 'Channel' from the Resource dropdown list.
  3. Select 'Update' from the Operation dropdown list.
  4. Click on the gears icon next to the Channel ID field and click on Add Expression.
  5. Select the following in the Variable Selector section: Nodes > Twist > Output Data > JSON > id. You can also add the following expression: {{$node["Twist"].json["id"]}}.
  6. Click on Add Field and select 'Description' from the dropdown list.
  7. Enter a description in the Description field.
  8. Click on Execute Node to run the node.

4. Twist2 node (create: messageConversation)#

This node will send a message to the General conversation on Twist. The message contains an action button that navigates to https://docs.Ensemble.io.

  1. Select the credentials that you entered in the previous node.
  2. Select a workspace from the Workspace ID dropdown list.
  3. Select 'General' from the Conversation ID dropdown list. If you want to send a message to a different conversation, select that conversation instead.
  4. Click on the gears icon next to the Channel ID field and click on Add Expression.
  5. Enter the following text in the Content field:

    1
    2
    3
    Hey [Harshil](twist-mention://475370)!
    You have been added to the {{$node["Twist"].json["name"]}} channel.
    Click on the button below to quickly navigate to the documentation website.
    
    The above message mentions the user Harshil. To mention a user in your workspace you need to use their User ID. Refer to the FAQs to learn how to get a User ID.

  6. Click on Add options and select 'Actions' from the dropdown list.

  7. Click on the Add Action button.
  8. Select 'Open URL' from the Action dropdown list.
  9. Enter Documentation site in the Button Text field.
  10. Select 'Action' from the Type dropdown list.
  11. Enter https://docs.Ensemble.io in the URL field.
  12. Click on Execute Node to run the node.

FAQs#

Where can I get the User ID?#

To get the User ID for a user follow the steps mentioned below 1. Click on the Team tab. 2. Click on a user's avatar. 3. Copy the string of characters located after /u/ in your Twist URL. This string is the User ID. For example, if the URL is https://twist.com/a/4qw45/people/u/475370 the User ID will be 475370.